Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Installation

The package is available at nuget.org and it can be installed via the Package Manager Console by executing the following command:

NuGet\Install-Package GroupDocs.Conversion-Cloud

Version NuGet NuGet-GroupDocsCloud


Requirements

  • .NET Framework 2.0 or .NET Standard 2.0
  • NuGet
  • System.Web when targeting .NET Framework 2.0
  • GroupDocs Cloud credentials — Client ID and Client Secret from the Dashboard

Quick Start

Get your API credentials

To use GroupDocs.Conversion Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Conversion Cloud SDK for .NET.

using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;

// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";

var config = new Configuration(MyClientId, MyClientSecret);
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ConvertApi(config);

See the full example in Constants.cs.

Convert a document (direct, no cloud storage)

Once initialized, use this basic example to convert a local document and receive the result directly.

using System;
using System.IO;
using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ConvertApi(config);

var fileStream = File.Open("four-pages.docx", FileMode.Open);
var request = new ConvertDocumentDirectRequest("pdf", fileStream);

var response = apiInstance.ConvertDocumentDirect(request);
Console.WriteLine("Document converted successfully: " + response.Length);

See the full example in ConvertToPdfDirect.cs.

Convert Documents Using Cloud Storage

This example uploads a file to GroupDocs Cloud storage, converts it, and downloads the result.

using System;
using System.IO;
using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;
using GroupDocs.Conversion.Cloud.Sdk.Model;
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;

var configuration = new Configuration("YourClientId", "YourClientSecret");

var fileApi = new FileApi(configuration);
var convertApi = new ConvertApi(configuration);

var fileStream = File.Open("myFile.docx", FileMode.Open);
fileApi.UploadFile(new UploadFileRequest("myFile.docx", fileStream));

var settings = new ConvertSettings
{
    FilePath = "myFile.docx",
    Format = "pdf",
    OutputPath = "converted"
};

convertApi.ConvertDocument(new ConvertDocumentRequest(settings));

var response = fileApi.DownloadFile(new DownloadFileRequest("converted/myFile.pdf"));
Console.WriteLine("Expected response type is Stream: " + response.Length.ToString());

See the SDK README for more details.

Convert Documents Between Various Formats Cloud API

This code converts a password-protected Word document to PDF with output options.

using System;
using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;
using GroupDocs.Conversion.Cloud.Sdk.Model;
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ConvertApi(config);

var settings = new ConvertSettings
{
    FilePath = "WordProcessing/password-protected.docx",
    Format = "pdf",
    LoadOptions = new WordProcessingLoadOptions { Password = "password" },
    ConvertOptions = new PdfConvertOptions
    {
        CenterWindow = true,
        CompressImages = false,
        DisplayDocTitle = true,
        Dpi = 1024,
        FromPage = 1,
        ImageQuality = 100,
        Password = "password",
        UnembedFonts = true
    },
    OutputPath = "converted"
};

var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
Console.WriteLine("Document converted successfully: " + response[0].Url);

See the full example in ConvertToPdf.cs.

Convert Specific Pages of a Document Cloud API

This example converts only pages 1 and 3.

using System;
using System.Collections.Generic;
using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;
using GroupDocs.Conversion.Cloud.Sdk.Model;
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ConvertApi(config);

var settings = new ConvertSettings
{
    FilePath = "WordProcessing/four-pages.docx",
    Format = "pdf",
    ConvertOptions = new PdfConvertOptions
    {
        Pages = new List<int?> { 1, 3 }
    },
    OutputPath = "converted/two-pages.pdf"
};

var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
Console.WriteLine("Document converted successfully: " + response[0].Url);

See the full example in ConvertSpecificPages .cs.

Get Supported Conversion Formats

Retrieve the supported source-to-target conversions.

using System;
using System.Linq;
using GroupDocs.Conversion.Cloud.Sdk.Api;
using GroupDocs.Conversion.Cloud.Sdk.Client;
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new InfoApi(config);

var response = apiInstance.GetSupportedConversionTypes(new GetSupportedConversionTypesRequest());

foreach (var entry in response.Take(2))
{
    Console.WriteLine($"{entry.SourceFormat}: {string.Join(",", entry.TargetFormats)}");
}

See the full example in GetSupportedConversions.cs.

Examples on GitHub

The GroupDocs.Conversion Cloud .NET Examples repository includes ready-to-run examples covering:

CategoryExamples
ConvertPDF, HTML, image, presentation, spreadsheet, word processing; direct conversion; async conversion
Common OptionsWatermarks, specific pages, consecutive pages, custom fonts
Load OptionsCAD, CSV, email, HTML, OneNote, PDF, presentation, spreadsheet, text, word processing
InfoSupported conversions, document information, license information, license consumption

How to run the examples

  1. Clone or download the examples repository
  2. Open Examples/GroupDocs.Conversion.Cloud.Examples.CSharp.sln in Visual Studio 2017 or later
  3. Right-click the solution and select Enable NuGet Package Restore
  4. Edit Examples/GroupDocs.Conversion.Cloud.Examples.CSharp/RunExamples.cs and set Constants.MyClientId and Constants.MyClientSecret
  5. Build and run

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Conversion API | .NET Cloud API | GroupDocs.Conversion Cloud | REST API | Document Conversion | Auto-detect Formats | Watermarking API | Multi-Format Output | Batch Document Conversion | PDF Conversion | Custom Conversion Options | Page-by-Page Conversion | Font Replacement | OCR Support | Metadata Extraction | Document Merge | Storage API | Document Information API | Document Load Options | Multi-Language Support | Cloud Storage Integration | SDKs for .NET, Java, Python | Secure API Access | Docker Support | Scalable Document Conversion | API Rate Limiting



 English