@@ -16,22 +16,22 @@ Before you can make any requests to GroupDocs Cloud API you need to get a Client
1616## Convert document
1717
1818``` csharp
19- using System ;
20- using System .Diagnostics ;
2119using GroupDocs .Conversion .Cloud .Sdk .Api ;
20+ using GroupDocs .Conversion .Cloud .Sdk .Client ;
21+ using GroupDocs .Conversion .Cloud .Sdk .Model .Requests ;
2222
23- namespace Example
23+ namespace ConversionCloudExample
2424{
25- public class Example
25+ internal class Program
2626 {
27- public void Main ()
27+ static void Main (string [] args )
2828 {
2929 // For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samples
3030 string MyClientSecret = " " ; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
3131 string MyClientId = " " ; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
32-
32+
3333 var configuration = new Configuration (MyClientId , MyClientSecret );
34-
34+
3535 // Create necessary API instances
3636 var apiInstance = new ConvertApi (configuration );
3737
@@ -45,35 +45,37 @@ namespace Example
4545 }
4646 }
4747}
48+
4849```
4950
5051## Convert document using cloud storage
5152
5253``` csharp
53- using System ;
54- using System .Diagnostics ;
5554using GroupDocs .Conversion .Cloud .Sdk .Api ;
55+ using GroupDocs .Conversion .Cloud .Sdk .Client ;
56+ using GroupDocs .Conversion .Cloud .Sdk .Model ;
57+ using GroupDocs .Conversion .Cloud .Sdk .Model .Requests ;
5658
57- namespace Example
59+ namespace ConversionCloudExample
5860{
59- public class Example
61+ internal class Program
6062 {
61- public void Main ()
63+ static void Main (string [] args )
6264 {
6365 // For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samples
6466 string MyClientSecret = " " ; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
6567 string MyClientId = " " ; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
66-
68+
6769 var configuration = new Configuration (MyClientId , MyClientSecret );
6870
6971 // Create necessary API instances
7072 var fileApi = new FileApi (configuration );
7173 var convertApi = new ConvertApi (configuration );
72-
74+
7375 // Upload file to cloud storage
7476 var fileStream = File .Open (" myFile.docx" , FileMode .Open );
7577 fileApi .UploadFile (new UploadFileRequest (" myFile.docx" , fileStream ));
76-
78+
7779 // Prepare convert settings
7880 var settings = new ConvertSettings
7981 {
@@ -83,12 +85,12 @@ namespace Example
8385 };
8486
8587 // Convert to specified format
86- apiInstance .ConvertDocument (new ConvertDocumentRequest (settings ));
88+ convertApi .ConvertDocument (new ConvertDocumentRequest (settings ));
8789
8890 // Download the result
8991
90- var response = apiInstance .DownloadFile (new DownloadFileRequest (" converted/myFile.pdf" );
91- Console .WriteLine (" Expected response type is Stream: " + response .Length .ToString ());
92+ var response = fileApi .DownloadFile (new DownloadFileRequest (" converted/myFile.pdf" ) );
93+ Console .WriteLine (" Expected response type is Stream: " + response .Length .ToString ());
9294 }
9395 }
9496}
0 commit comments