Skip to content

Commit 3d66eca

Browse files
committed
Updated sources
1 parent b660727 commit 3d66eca

221 files changed

Lines changed: 355 additions & 408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2003-2020 Aspose Pty Ltd
3+
Copyright (c) 2003-2019 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 50 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,65 @@
1-
![](https://img.shields.io/badge/api-v2.0-lightgrey) ![Nuget](https://img.shields.io/nuget/v/GroupDocs.Conversion-Cloud) ![Nuget](https://img.shields.io/nuget/dt/GroupDocs.Conversion-Cloud) [![GitHub license](https://img.shields.io/github/license/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet)](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet/blob/master/LICENSE)
1+
# GroupDocs.Conversion Cloud SDK for .NET
22

3-
# .NET SDK to Convert Documents in the Cloud
3+
This repository contains GroupDocs.Conversion Cloud SDK for .NET source code. This SDK allows you to work with GroupDocs.Conversion Cloud REST APIs in your .NET applications.
44

5-
[GroupDocs.Conversion Cloud SDK for .NET](https://products.groupdocs.cloud/conversion/net) wraps GroupDocs.Conversion RESTful APIs so you may integrate Document Conversion features in your own apps with zero initial cost.
5+
## How to use the SDK
66

7-
GroupDocs.Conversion Cloud API allows the developers to convert between 50+ file formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument files, images & more.
7+
The complete source code is available in this repository folder, you can either directly use it in your project via NuGet package manager. For more details, please visit our [documentation website](https://docs.groupdocs.cloud/display/conversioncloud/Available+SDKs#AvailableSDKs-.NET).
88

9-
## Document Conversion REST API
10-
11-
- Convert the whole document to the desired target format.
12-
- Convert specific document page(s) or a page range.
13-
- Auto-detect source document format without requiring the file extension.
14-
- Load source document with extended options, such as specify password for password-protected documents.
15-
- Load specific part of the document.
16-
- Show or hide document comments.
17-
- Obtain all supported conversion formats list.
18-
- Replace missing fonts with any other font.
19-
- Add text or image watermarks to any page.
20-
- Specify resolution and quality for resultant images.
21-
- Extract metadata & basic information about the source document.
22-
- Integrated storage API.
23-
24-
Check out the [Developer's Guide](https://docs.groupdocs.cloud/conversion/developer-guide/) to know more about GroupDocs.Conversion REST API.
25-
26-
## Microsoft File Formats
27-
28-
**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\
29-
**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\
30-
**Microsoft PowerPoint:** PPT, PPTX, PPS, PPSX\
31-
**Microsoft Project:** MPP, MPT\
32-
**Microsoft Outlook:** MSG, EML\
33-
**Microsoft Visio:** VSD, VDX, VSS, VSX, VST, VTX, VSDX, VDW, VSSX, VSTX, VSDM, VSTM, VSSM\
34-
**Microsoft OneNote:** ONE
35-
36-
## Other Formats
37-
38-
**Page Layout Formats:** PDF, XPS\
39-
**OpenDocument:** ODT, OTT, ODS, ODP, OTP, OTS, ODG\
40-
**CAD:** DXF, DWG, IFC, STL\
41-
**Images:** DCM, BMP, GIF, JPG, PNG, TIFF, WebP, DjVu, SVG, DNG, ICO\
42-
**Web:** HTML, MHT, MHTML\
43-
**Emails:** EML, EMLX\
44-
**eBooks:** EPUB, MOBI\
45-
**Metafile:** WMF, EMF\
46-
**LaTeX:** TEX\
47-
**Others:** TXT, RTF, CSV, TSV, XML
48-
49-
## Get Started with GroupDocs.Conversion Cloud SDK for .NET
50-
51-
First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, execute `Install-Package GroupDocs.Conversion-Cloud` from Package Manager Console in Visual Studio to fetch & reference the SDK in your project. If you already have the package and wish to upgrade it, please execute `Update-Package GroupDocs.Conversion-Cloud` to get the latest version.
52-
53-
### Dependencies
9+
## Dependencies
5410

5511
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json)
5612

57-
## Convert DOCX to PDF in the Cloud
13+
## Getting Started
5814

5915
```csharp
60-
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
61-
string MyClientId = "";
62-
string MyClientSecret = "";
16+
using System;
17+
using System.Diagnostics;
18+
using GroupDocs.Conversion.Cloud.Sdk.Api;
6319

64-
// Create instance of the API
65-
var configuration = new Configuration(MyClientId, MyClientSecret);
66-
var apiInstance = new ConvertApi(configuration);
67-
68-
// Prepare convert settings
69-
var settings = new ConvertSettings
20+
namespace Example
7021
{
71-
FilePath = "WordProcessing/four-pages.docx",
72-
Format = "pdf",
73-
OutputPath = "converted"
74-
};
75-
76-
// Convert to specified format
77-
var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
22+
public class Example
23+
{
24+
public void Main()
25+
{
26+
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
27+
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
28+
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
29+
30+
var api = new InfoApi(appSid, appKey);
31+
32+
try
33+
{
34+
// Get supported file formats
35+
var formats = api.GetSupportedConversionTypes(new GetSupportedConversionTypesRequest());
36+
37+
foreach (var format in formats)
38+
{
39+
Debug.Print(format.SourceFormat);
40+
}
41+
}
42+
catch (Exception e)
43+
{
44+
Debug.Print("Something went wrong: " + e.Message);
45+
}
46+
}
47+
}
48+
}
7849
```
7950

80-
## GroupDocs.Conversion Cloud SDKs in Popular Languages
51+
## Licensing
52+
53+
All GroupDocs.Conversion Cloud SDKs are licensed under [MIT License](LICENSE).
54+
55+
## Resources
56+
57+
+[**Website**](https://www.groupdocs.cloud)
58+
+[**Product Home**](https://products.groupdocs.cloud/conversion)
59+
+[**Documentation**](https://docs.groupdocs.cloud/conversion)
60+
+[**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion)
61+
+[**Blog**](https://blog.groupdocs.cloud/category/conversion)
8162

82-
| .NET | Java | PHP | Python | Ruby | Node.js | Android |
83-
|---|---|---|---|---|---|---|
84-
| [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-ruby) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node) | [GitHub](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android) |
85-
| [NuGet](https://www.nuget.org/packages/GroupDocs.Conversion-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-conversion-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-conversion-cloud) | [PIP](https://pypi.org/project/groupdocs-conversion-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_conversion_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-conversion-cloud) | |
63+
## Contact Us
8664

87-
[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/conversion/net) | [Documentation](https://docs.groupdocs.cloud/conversion/) | [Live Demo](https://products.groupdocs.app/conversion/total) | [API Reference](https://apireference.groupdocs.cloud/conversion/) | [Code Samples](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samples) | [Blog](https://blog.groupdocs.cloud/category/conversion/) | [Free Support](https://forum.groupdocs.cloud/c/conversion) | [Free Trial](https://dashboard.groupdocs.cloud)
65+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/conversion).

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/AuthApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/BaseApiTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/ConvertApiTests.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,6 +24,7 @@
2424
// --------------------------------------------------------------------------------------------------------------------
2525

2626
using System.IO;
27+
using GroupDocs.Conversion.Cloud.Sdk.Client;
2728
using GroupDocs.Conversion.Cloud.Sdk.Model;
2829
using GroupDocs.Conversion.Cloud.Sdk.Model.Requests;
2930
using GroupDocs.Conversion.Cloud.Sdk.Test.Api.Internal;
@@ -97,5 +98,39 @@ public void ConvertDocumentDirectTest()
9798
Assert.IsNotNull(result);
9899
Assert.Greater(result.Length, 0);
99100
}
101+
102+
[Test]
103+
public void TestConvertMissingSettings()
104+
{
105+
// Arrange
106+
var request = new ConvertDocumentRequest(null);
107+
108+
// Act & Assert
109+
var ex = Assert.Throws<ApiException>(() =>
110+
{
111+
ConvertApi.ConvertDocumentDownload(request);
112+
});
113+
Assert.True(ex.Message.Contains("Missing required parameter 'convertSettings'"));
114+
}
115+
116+
[Test]
117+
public void TestConversionFileNotFound()
118+
{
119+
var settings = new ConvertSettings
120+
{
121+
FilePath = TestFiles.NotExist.FullName,
122+
Format = "pdf"
123+
};
124+
125+
// Arrange
126+
var request = new ConvertDocumentRequest(settings);
127+
128+
// Act & Assert
129+
var ex = Assert.Throws<ApiException>(() =>
130+
{
131+
ConvertApi.ConvertDocumentDownload(request);
132+
});
133+
Assert.True(ex.Message.Contains("The specified key does not exist"));
134+
}
100135
}
101-
}
136+
}

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/FileApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/FolderApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/InfoApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/Internal/TestFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/GroupDocs.Conversion.Cloud.Sdk.Test/Api/Internal/TestFiles.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose Pty Ltd" file="TestFiles.cs">
3-
// Copyright (c) 2003-2019 Aspose Pty Ltd
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

0 commit comments

Comments
 (0)