Last active
June 9, 2019 20:02
-
-
Save groupdocscloud/caf8bcd223759d65afaa07436f251820 to your computer and use it in GitHub Desktop.
This Gist contains .NET examples of GroupDocs.Viewer Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Viewer-CSharp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetAttachmentsRequest | |
{ | |
FileName = "with-attachment.msg", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetAttachments(request); | |
Debug.Print("No. of Attachments: " + response.Attachments.Count); | |
Debug.Print("First Attachment Name: " + response.Attachments[0].Name); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
class Common | |
{ | |
public static string MyAppSid = Common.MyAppSid; | |
public static string MyAppKey = Common.MyAppKey; | |
public static string MyStorage = Common.MyStorage; | |
public static void UploadSampleTestFiles() | |
{ | |
var storageConfig = new Configuration(MyAppSid, MyAppKey); | |
StorageApi storageApi = new StorageApi(storageConfig); | |
FolderApi folderApi = new FolderApi(storageConfig); | |
FileApi fileApi = new FileApi(storageConfig); | |
var path = "..\\..\\..\\Data"; | |
Console.WriteLine("File Upload Processing..."); | |
var dirs = Directory.GetDirectories(path, "*", SearchOption.AllDirectories); | |
foreach (var dir in dirs) | |
{ | |
var relativeDirPath = dir.Replace(path, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var response = storageApi.ObjectExists(new Sdk.Model.Requests.ObjectExistsRequest(relativeDirPath, MyStorage)); | |
if (!response.Exists.Value) | |
{ | |
folderApi.CreateFolder(new Sdk.Model.Requests.CreateFolderRequest(relativeDirPath, MyStorage)); | |
} | |
} | |
var files = Directory.GetFiles(path, "*", SearchOption.AllDirectories); | |
foreach (var file in files) | |
{ | |
var relativeFilePath = file.Replace(path, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var response = storageApi.ObjectExists(new Sdk.Model.Requests.ObjectExistsRequest(relativeFilePath, MyStorage)); | |
if (!response.Exists.Value) | |
{ | |
var fileName = Path.GetFileName(file); | |
var relativeDirPath = relativeFilePath.Replace(fileName, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var fileStream = File.Open(file, FileMode.Open); | |
fileApi.UploadFile(new Sdk.Model.Requests.UploadFileRequest(relativeFilePath, fileStream, MyStorage)); | |
fileStream.Close(); | |
} | |
} | |
Console.WriteLine("File Upload Process Completed."); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Copy File | |
class Copy_File | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FileApi(configuration); | |
try | |
{ | |
var request = new CopyFileRequest("viewerdocs/one-page1.docx", "viewerdocs/one-page-copied.docx", Common.MyStorage, Common.MyStorage); | |
apiInstance.CopyFile(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs/one-page1.docx' file copied as 'viewerdocs/one-page-copied.docx'."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FileApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Copy Folder | |
class Copy_Folder | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FolderApi(configuration); | |
try | |
{ | |
var request = new CopyFolderRequest("viewerdocs", "viewerdocs1", Common.MyStorage, Common.MyStorage); | |
apiInstance.CopyFolder(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs' folder copied as 'viewerdocs1'."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FolderApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreateAttachmentPagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
AttachmentPassword = "password" | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreateAttachmentPagesCache(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Attachment name:" + response.AttachmentName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreateAttachmentPagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions | |
{ | |
AttachmentPassword = "password" | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreateAttachmentPagesCache(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:"+ response.Pages.Count); | |
Debug.Print("File name:"+ response.FileName); | |
Debug.Print("Attachment name:"+ response.AttachmentName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample.DXF", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EmbedResources = true, | |
CadOptions = new CadOptions() { Layers = new List<string>() { "SLD-0", "DEFAULT_3" } } | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheRequest | |
{ | |
FileName = "sample.DXF", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions | |
{ | |
Format = "jpg", | |
Quality = 100, | |
CadOptions = new CadOptions() { Layers = new List<string>() { "SLD-0", "DEFAULT_3" } } | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample.docx", | |
Folder = "viewerdocs", | |
Storage = null, | |
HtmlOptions = new HtmlOptions | |
{ | |
EmbedResources = true | |
}, | |
FontsFolder = null | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("Expected response type is HtmlPageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Html Pages Cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheRequest | |
{ | |
FileName = "sample.docx", | |
Folder = "viewerdocs", | |
Storage = null, | |
ImageOptions = new ImageOptions | |
{ | |
Format = "jpg" | |
}, | |
FontsFolder = null | |
}; | |
var response = apiInstance.ImageCreatePagesCache(request); | |
Debug.Print("Expected response type is ImagePageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Image Pages Cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
HtmlOptions = new HtmlOptions | |
{ | |
EmbedResources = false | |
}, | |
FileName = "one-page.docx", | |
FontsFolder = null, | |
Folder = null, | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.HtmlCreatePagesCacheFromUrl(request); | |
Debug.Print("Expected response type is HtmlPageCollection" + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Html Pages Cache from document Url: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
ImageOptions = new ImageOptions | |
{ | |
Format = "jpg" | |
}, | |
FileName = "one-page.docx", | |
FontsFolder = null, | |
Folder = null, | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.ImageCreatePagesCacheFromUrl(request); | |
Debug.Print("Expected response type is ImagePageCollection" + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Image Pages Cache from document Url: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create Folder | |
class Create_Folder | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FolderApi(configuration); | |
try | |
{ | |
var request = new CreateFolderRequest("", Common.MyStorage); | |
apiInstance.CreateFolder(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs' folder created."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FolderApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "one-page.docx", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EmbedResources = true | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheRequest | |
{ | |
FileName = "one-pagetest.docx", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions | |
{ | |
Format = "jpg" | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "one-page.docx", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EnableMinification = true, | |
EmbedResources = true | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var htmlOptions = new HtmlOptions | |
{ | |
Watermark = new Watermark() { Text = "GroupDocs API" } | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(htmlOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new HtmlCreatePagesCacheFromContentRequest | |
{ | |
HtmlOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/one-page.docx")), | |
FileName = "one-page-output.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.HtmlCreatePagesCacheFromContent(request); | |
Debug.Print("Expected response type is HtmlPageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating HTML Pages from Contents: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var imageOptions = new ImageOptions | |
{ | |
Format = "jpg" | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(imageOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new ImageCreatePagesCacheFromContentRequest | |
{ | |
ImageOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/one-page.docx")), | |
FileName = "one-page-output.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.ImageCreatePagesCacheFromContent(request); | |
Debug.Print("Expected response type is ImagePageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Image Pages from Contents: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EmbedResources = false | |
}, | |
FileName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCacheFromUrl(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions | |
{ | |
Format = "jpg" | |
}, | |
FileName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePagesCacheFromUrl(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var htmlOptions = new HtmlOptions | |
{ | |
Password = "" | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(htmlOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new HtmlCreatePagesCacheFromContentRequest | |
{ | |
HtmlOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/sample.docx")), | |
FileName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCacheFromContent(request); | |
Debug.Print("Expected response type is HtmlPageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Html Pages from Contents: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var imageOptions = new ImageOptions | |
{ | |
Format = "jpg" | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(imageOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new ImageCreatePagesCacheFromContentRequest | |
{ | |
ImageOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/one-page.docx")), | |
FileName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePagesCacheFromContent(request); | |
Debug.Print("Expected response type is ImagePageCollection" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating Image Pages from Contents: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePdfFileFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
PdfFileOptions = new PdfFileOptions() { Watermark = new Watermark() { Text = "GroupDocs Cloud API's", Color = "Magenta", Position = "Diagonal", Size = 50 } } | |
}; | |
var response = apiInstance.HtmlCreatePdfFileFromUrl(request); | |
Debug.Print("Expected response type is PdfFileInfo" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating PDF Document from document Url for Html Representation: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePdfFileFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
PdfFileOptions = new PdfFileOptions() { Watermark = new Watermark() { Text = "GroupDocs Cloud API's", Color = "Magenta", Position = "Diagonal", Size = 50 } } | |
}; | |
var response = apiInstance.ImageCreatePdfFileFromUrl(request); | |
Debug.Print("Expected response type is PdfFileInfo" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating PDF Document from document Url for Image Representation: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pdfFileOptions = new PdfFileOptions | |
{ | |
Watermark = new Watermark() { Text = "GroupDocs API" } | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(pdfFileOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new HtmlCreatePdfFileFromContentRequest | |
{ | |
PdfFileOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/one-page.docx")), | |
FileName = "one-page-output.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.HtmlCreatePdfFileFromContent(request); | |
Debug.Print("Expected response type is PdfFileInfo" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating PDF File from Contents for HTML representation: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pdfFileOptions = new PdfFileOptions | |
{ | |
Watermark = new Watermark() { Text = "GroupDocs API" } | |
}; | |
var options = new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
}; | |
var json = JsonConvert.SerializeObject(pdfFileOptions, options); | |
var bytes = Encoding.UTF8.GetBytes(json); | |
var request = new ImageCreatePdfFileFromContentRequest | |
{ | |
PdfFileOptions = new MemoryStream(bytes), | |
File = new MemoryStream(File.ReadAllBytes("D:/one-page.docx")), | |
FileName = "one-page-output.docx", | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.ImageCreatePdfFileFromContent(request); | |
Debug.Print("Expected response type is PdfFileInfo" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Creating PDF File from Contents for Image representation: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample.mpp", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EmbedResources = true, | |
ProjectOptions = new ProjectOptions() { PageSize = "A4", TimeUnit = "Unknown" } | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheRequest | |
{ | |
FileName = "sample.mpp", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions | |
{ | |
Format = "jpg", | |
Quality = 100, | |
ProjectOptions = new ProjectOptions() { PageSize = "A4", TimeUnit = "Unknown" } | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With CAD Options | |
class Create_View_With_CAD_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/three-layouts.dwf", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
CadOptions = new CadOptions() | |
{ | |
Width = 800 | |
} | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Fonts Path Options | |
class Create_View_With_Fonts_Path_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/uses-custom-font.pptx", | |
Password = "", | |
StorageName = Common.MyStorage, | |
}, | |
ViewFormat = ViewOptions.ViewFormatEnum.PNG, | |
FontsPath = "font/ttf" | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With HTML View Format | |
class Create_View_With_HTML_View_Format | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
ViewFormat = ViewOptions.ViewFormatEnum.HTML | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With HTML ViewOptions | |
class Create_View_With_HTML_ViewOptions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/three-layouts.dwf", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new HtmlOptions() | |
{ | |
ExternalResources = true | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Image View Format | |
class Create_View_With_Image_View_Format | |
{ | |
public static void Run(ViewOptions.ViewFormatEnum format) | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
ViewFormat = format | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Minimal & Default ViewFormat & ViewOptions | |
class Create_View_With_Minimal_ViewOptions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Output Path & ViewOptions | |
class Create_View_With_OutputPath | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/sample.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
OutputPath = "viewerdocs" | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Project Options | |
class Create_View_With_Project_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/sample.mpp", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
ProjectManagementOptions = new ProjectManagementOptions() | |
{ | |
PageSize = "Unknown", | |
TimeUnit = "Months", | |
StartDate = new DateTime(2008, 7, 1), | |
EndDate = new DateTime(2008, 7, 31) | |
} | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Responsive HTML & ViewOptions | |
class Create_View_With_Responsive_HTML | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/three-layouts.dwf", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new HtmlOptions() | |
{ | |
IsResponsive = true | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Spreadsheet Options | |
class Create_View_With_SpreadsheetOptions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/with-hidden-rows-and-columns.xlsx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
SpreadsheetOptions = new SpreadsheetOptions() | |
{ | |
PaginateSheets = true, | |
CountRowsPerPage = 5 | |
} | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Create View With Start Page & To Count Pages | |
class Create_View_With_StartPage_And_CountPages | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/four-pages.docx", | |
Password = "", | |
StorageName = Common.MyStorage, | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
StartPageNumber = 2, | |
CountPagesToRender = 2 | |
} | |
}; | |
var request = new CreateViewRequest(viewOptions); | |
var response = apiInstance.CreateView(request); | |
Console.WriteLine("Expected response type is ViewResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlDeleteAttachmentPagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Folder = null, | |
Storage = null, | |
}; | |
apiInstance.HtmlDeleteAttachmentPagesCache(request); | |
Debug.Print("Cache deleted successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageDeleteAttachmentPagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Folder = null, | |
Storage = null, | |
}; | |
apiInstance.ImageDeleteAttachmentPagesCache(request); | |
Debug.Print("Cache deleted successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Delete File | |
class Delete_File | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FileApi(configuration); | |
try | |
{ | |
var request = new DeleteFileRequest("viewerdocs1/one-page1.docx", Common.MyStorage); | |
apiInstance.DeleteFile(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs1/one-page1.docx' deleted."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FileApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Delete Folder | |
class Delete_Folder | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FolderApi(configuration); | |
try | |
{ | |
var request = new DeleteFolderRequest("viewerdocs/viewerdocs1", Common.MyStorage, true); | |
apiInstance.DeleteFolder(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs/viewerdocs1' folder deleted recusrsively."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FolderApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new DeleteFontsCacheRequest(); | |
apiInstance.DeleteFontsCache(request); | |
Debug.Print("Removed Fonts Cache"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Deleting Fonts Cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlDeletePagesCacheRequest | |
{ | |
FileName = "one-page.docx", | |
Folder = null, | |
Storage = null, | |
}; | |
apiInstance.HtmlDeletePagesCache(request); | |
Debug.Print("Cache Deleted"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when deleting cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageDeletePagesCacheRequest | |
{ | |
FileName = "one-page.docx", | |
Folder = null, | |
Storage = null, | |
}; | |
apiInstance.ImageDeletePagesCache(request); | |
Debug.Print("Cache Deleted"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when deleting cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Delete View With Default ViewFormat | |
class Delete_View_With_Default_ViewFormat | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new ViewApi(configuration); | |
try | |
{ | |
var deleteOptions = new DeleteViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
} | |
}; | |
var request = new DeleteViewRequest(deleteOptions); | |
apiInstance.DeleteView(request); | |
Console.WriteLine("Expected response type is Void: View deleted with default View Format."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling ViewApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPageRequest | |
{ | |
FileName = "sample.docx", | |
PageNumber = 1, | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPage(request); | |
Debug.Print("Expected response type is System.IO.Stream" + response.Length); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting Html Page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetPageRequest | |
{ | |
FileName = "sample.docx", | |
PageNumber = 1, | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
Password = null, | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = "viewerdocs", | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetPage(request); | |
Debug.Print("Expected response type is System.IO.Stream" + response.Length); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting Image Page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Download_File | |
class Download_File | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FileApi(configuration); | |
try | |
{ | |
var request = new DownloadFileRequest("viewerdocs/one-page.docx", Common.MyStorage); | |
var response = apiInstance.DownloadFile(request); | |
Console.WriteLine("Expected response type is Stream: " + response.Length.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FileApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXX-XX", | |
AppKey = "XXXX" | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPagesRequest | |
{ | |
FileName = "one-page1.docx", | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
ExcludeFonts = true | |
}; | |
var response = apiInstance.HtmlGetPages(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new GetFontsRequest(); | |
var response = apiInstance.GetFonts(request); | |
Debug.Print("Expected response type is FontCollection" + response.Families.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Getting Fonts: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new GetSupportedFileFormatsRequest(); | |
// Get supported file formats | |
var response = apiInstance.GetSupportedFileFormats(request); | |
foreach (var format in response.Formats) | |
{ | |
Debug.Print(format.ToString()); | |
} | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when calling ViewerApi.DeleteFontsCache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetAttachmentRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetAttachment(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try { | |
var request = new ImageGetAttachmentRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetAttachment(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
var storageApi = new StorageApi(configuration); | |
try | |
{ | |
var request = new HtmlGetAttachmentInfoRequest | |
{ | |
FileName = "Test.msg", | |
AttachmentName = "Test.pdf", | |
Password = null, | |
AttachmentPassword = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetAttachmentInfo(request); | |
Debug.Print("Attachment Pages:" + response.Pages.Count); | |
Debug.Print("Attachment Extension:"+ response.Extension); | |
Debug.Print("Attachment Name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachment from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
var storageApi = new StorageApi(configuration); | |
try | |
{ | |
var request = new ImageGetAttachmentInfoRequest | |
{ | |
FileName = "Test.msg", | |
AttachmentName = "Freescale OSC.pdf", | |
Password = null, | |
AttachmentPassword = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetAttachmentInfo(request); | |
Debug.Print("Attachment Pages:" + response.Pages.Count); | |
Debug.Print("Attachment Extension:" + response.Extension); | |
Debug.Print("Attachment Name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachment from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
var storageApi = new StorageApi(configuration); | |
try | |
{ | |
var request = new HtmlGetAttachmentInfoWithOptionsRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
DocumentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
AttachmentPassword = "password" | |
}, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetAttachmentInfoWithOptions(request); | |
Debug.Print("Attachment Pages:" + response.Pages.Count); | |
Debug.Print("Attachment Extension:" + response.Extension); | |
Debug.Print("Attachment Name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachment from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
var storageApi = new StorageApi(configuration); | |
try | |
{ | |
var request = new ImageGetAttachmentInfoWithOptionsRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
DocumentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
AttachmentPassword = "password" | |
}, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetAttachmentInfoWithOptions(request); | |
Debug.Print("Attachment Pages:" + response.Pages.Count); | |
Debug.Print("Attachment Extension:" + response.Extension); | |
Debug.Print("Attachment Name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachment from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pageNumber = 1; | |
var request = new HtmlGetAttachmentPageRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
PageNumber = pageNumber, | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
AttachmentPassword = "password", | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetAttachmentPage(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pageNumber = 1; | |
var request = new ImageGetAttachmentPageRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
PageNumber = pageNumber, | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
Password = null, | |
AttachmentPassword = "password", | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetAttachmentPage(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pageNumber = 1; | |
var request = new HtmlGetAttachmentPageResourceRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
PageNumber = pageNumber, | |
ResourceName = "styles.css", | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetAttachmentPageResource(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetAttachmentPagesRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
AttachmentPassword = "password", | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetAttachmentPages(request); | |
Debug.Print("Pages count:"+ response.Pages.Count); | |
Debug.Print("File name:"+ response.FileName); | |
Debug.Print("Attachment name:" + response.AttachmentName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetAttachmentPagesRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
StartPageNumber = null, | |
CountPages = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
AttachmentPassword = "password", | |
ExtractText = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetAttachmentPages(request); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Attachment name:" + response.AttachmentName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetZipWithAttachmentPagesRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
ResourcePath = "./r{page-number}/{resource-name}", | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
AttachmentPassword = "password", | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetZipWithAttachmentPages(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetZipWithAttachmentPagesRequest | |
{ | |
FileName = "with-attachment.msg", | |
AttachmentName = "password-protected.docx", | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
StartPageNumber = null, | |
CountPages = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
AttachmentPassword = "password", | |
ExtractText = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetZipWithAttachmentPages(request); | |
Debug.Print("Document processed successfully"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetAttachmentsRequest | |
{ | |
FileName = "with-attachment.msg", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetAttachments(request); | |
Debug.Print("No. of Attachments: " + response.Attachments.Count); | |
Debug.Print("First Attachment Name: " + response.Attachments[0].Name); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting attachments from Email: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetDocumentInfoRequest | |
{ | |
FileName = "sample.DXF", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetDocumentInfo(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Layers count:" + response.Layers.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetDocumentInfoRequest | |
{ | |
FileName = "sample.DXF", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetDocumentInfo(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Layers count:" + response.Layers.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Get Disc Usage | |
class Get_Disc_Usage | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new StorageApi(configuration); | |
try | |
{ | |
var request = new GetDiscUsageRequest(Common.MyStorage); | |
var response = apiInstance.GetDiscUsage(request); | |
Console.WriteLine("Expected response type is DiscUsage: " + response.UsedSize.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling StorageApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var documentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
Password = "password" | |
}; | |
var request = new HtmlGetDocumentInfoFromContentRequest | |
{ | |
DocumentInfoOptions = this.SerializeObject(documentInfoOptions), | |
File = this.GetTestFileStream("password-protected.docx"), | |
FileName = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetDocumentInfoFromContent(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var documentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
Password = "password" | |
}; | |
var request = new ImageGetDocumentInfoFromContentRequest | |
{ | |
DocumentInfoOptions = this.SerializeObject(documentInfoOptions), | |
File = this.GetTestFileStream("password-protected.docx"), | |
FileName = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetDocumentInfoFromContent(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetDocumentInfoRequest | |
{ | |
FileName = "one-page.docx", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetDocumentInfo(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetDocumentInfoRequest | |
{ | |
FileName = "one-page.docx", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetDocumentInfo(request); | |
Debug.Print("Document processed successfully"); | |
Debug.Print("Pages count:" + response.Pages.Count); | |
Debug.Print("File name:" + response.FileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetDocumentInfoFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1", | |
FileName = "one-pagetest.docx", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetDocumentInfoFromUrl(request); | |
Debug.Print("File name:"+ response.FileName); | |
Debug.Print("Extension: "+ response.Extension); | |
Debug.Print("PageCount: "+ response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetDocumentInfoFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1", | |
FileName = "one-pagetest.docx", | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetDocumentInfoFromUrl(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Extension: " + response.Extension); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetDocumentInfoWithOptionsRequest | |
{ | |
FileName = "password-protected.docx", | |
DocumentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
Password = "password" | |
}, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetDocumentInfoWithOptions(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Extension: " + response.Extension); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetDocumentInfoWithOptionsRequest | |
{ | |
FileName = "password-protected.docx", | |
DocumentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions | |
{ | |
Password = "password" | |
}, | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetDocumentInfoWithOptions(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Extension: " + response.Extension); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var documentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions(); | |
var request = new HtmlGetDocumentInfoFromUrlWithOptionsRequest | |
{ | |
Url = "https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1", | |
DocumentInfoOptions = documentInfoOptions, | |
FileName = "one-pageurl.docx", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.HtmlGetDocumentInfoFromUrlWithOptions(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Extension: " + response.Extension); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var documentInfoOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.DocumentInfoOptions(); | |
var request = new ImageGetDocumentInfoFromUrlWithOptionsRequest | |
{ | |
Url = "https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1", | |
DocumentInfoOptions = documentInfoOptions, | |
FileName = "one-pageurl.docx", | |
Folder = null, | |
Storage = null | |
}; | |
var response = apiInstance.ImageGetDocumentInfoFromUrlWithOptions(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("Extension: " + response.Extension); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document info: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get File Versions | |
class Get_File_Versions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new StorageApi(configuration); | |
try | |
{ | |
var request = new GetFileVersionsRequest("one-page.docx", Common.MyStorage); | |
var response = apiInstance.GetFileVersions(request); | |
Console.WriteLine("Expected response type is FileVersions: " + response.Value.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling StorageApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Files List | |
class Get_Files_List | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FolderApi(configuration); | |
try | |
{ | |
var request = new GetFilesListRequest("viewerdocs", Common.MyStorage); | |
var response = apiInstance.GetFilesList(request); | |
Console.WriteLine("Expected response type is FilesList: " + response.Value.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FolderApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With CAD Options | |
class Get_Info_With_CAD_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/three-layouts.dwf", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
CadOptions = new CadOptions() | |
{ | |
ScaleFactor = 5f | |
} | |
} | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With HTML View Format | |
class Get_Info_With_HTML_View_Format | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
ViewFormat = ViewOptions.ViewFormatEnum.HTML | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With Image View Format | |
class Get_Info_With_Image_View_Format | |
{ | |
public static void Run(ViewOptions.ViewFormatEnum format) | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
ViewFormat = format | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With Image View Options | |
class Get_Info_With_Image_View_Options_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/one-page.docx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new ImageOptions() | |
{ | |
ExtractText = true | |
}, | |
ViewFormat = ViewOptions.ViewFormatEnum.PNG | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With Minimal ViewOptions | |
class Get_Info_With_Minimal_ViewOptions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/password-protected.docx", | |
Password = "password", | |
StorageName = Common.MyStorage | |
} | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With Project Options | |
class Get_Info_With_Project_Options | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/sample.mpp", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
ProjectManagementOptions = new ProjectManagementOptions() | |
{ | |
PageSize = "Unknown", | |
TimeUnit = "Months", | |
StartDate = new DateTime(2008, 7, 1), | |
EndDate = new DateTime(2008, 7, 31) | |
} | |
} | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get Document Information With Spreadsheet Options | |
class Get_Info_With_SpreadsheetOptions | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
var viewOptions = new ViewOptions() | |
{ | |
FileInfo = new FileInfo() | |
{ | |
FilePath = "viewerdocs/with-hidden-rows-and-columns.xlsx", | |
Password = "", | |
StorageName = Common.MyStorage | |
}, | |
RenderOptions = new RenderOptions() | |
{ | |
SpreadsheetOptions = new SpreadsheetOptions() | |
{ | |
PaginateSheets = true, | |
CountRowsPerPage = 5 | |
} | |
} | |
}; | |
var request = new GetInfoRequest(viewOptions); | |
var response = apiInstance.GetInfo(request); | |
Console.WriteLine("Expected response type is InfoResult: " + response.Pages.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPageRequest | |
{ | |
FileName = "one-page.docx", | |
PageNumber = 1, | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPage(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetPageRequest | |
{ | |
FileName = "one-pagetest.docx", | |
PageNumber = 1, | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
Password = null, | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetPage(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPagesRequest | |
{ | |
FileName = "one-page.docx", | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPages(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetPagesRequest | |
{ | |
FileName = "one-pagetest.docx", | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetPages(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPagesFromUrlRequest | |
{ | |
Url= "https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1", | |
FileName = "with-notes.pptx", | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPagesFromUrl(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetPagesFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1", | |
FileName = "with-notes.pptx", | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetPagesFromUrl(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPdfFileFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
FileName = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = "", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.HtmlGetPdfFileFromUrl(request); | |
Debug.Print("Expected response type is System.IO.Stream" + response.Length); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Dowmloading PDF Document from document Url for Html Representation: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPdfFileFromUrlRequest | |
{ | |
Url = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx", | |
FileName = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = "", | |
Storage = "First Storage", | |
}; | |
var response = apiInstance.HtmlGetPdfFileFromUrl(request); | |
Debug.Print("Expected response type is System.IO.Stream" + response.Length); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Dowmloading PDF Document from document Url: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPdfFileRequest | |
{ | |
FileName = "one-page.docx", | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPdfFile(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when processing document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetPdfFileRequest | |
{ | |
FileName = "one-page.docx", | |
RenderComments = null, | |
RenderHiddenPages = null, | |
Password = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetPdfFile(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when processing document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPageRequest | |
{ | |
FileName = "one-page.docx", | |
EnableResponsiveRendering = true, | |
PageNumber = 1, | |
EmbedResources = true, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPage(request); | |
Debug.Print("Result as IO Stream :" + response.Length.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting document page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Get All Supported Formats | |
class Get_All_Supported_Formats | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new InfoApi(configuration); | |
try | |
{ | |
// Get supported file formats | |
var response = apiInstance.GetSupportedFileFormats(); | |
foreach (var entry in response.Formats) | |
{ | |
Console.WriteLine(string.Format("{0}: {1}", entry.FileFormat, string.Join(",", entry.Extension))); | |
} | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling InfoApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions | |
{ | |
Watermark = new GroupDocs.Viewer.Cloud.Sdk.Model.Watermark { Text = "Test" } | |
}; | |
var request = new HtmlCreatePdfFileRequest | |
{ | |
FileName = "one-page.docx", | |
PdfFileOptions = pdfFileOptions, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePdfFile(request); | |
Debug.Print("Document Processed"); | |
Debug.Print(response.FileName); | |
Debug.Print(response.Folder); | |
Debug.Print(response.PdfFileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when processing document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var pdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions | |
{ | |
Watermark = new GroupDocs.Viewer.Cloud.Sdk.Model.Watermark { Text = "Test" } | |
}; | |
var request = new ImageCreatePdfFileRequest | |
{ | |
FileName = "one-page.docx", | |
PdfFileOptions = pdfFileOptions, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageCreatePdfFile(request); | |
Debug.Print("Document Processed"); | |
Debug.Print(response.FileName); | |
Debug.Print(response.Folder); | |
Debug.Print(response.PdfFileName); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when processing document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetZipWithPagesRequest | |
{ | |
FileName = "one-pagetest.docx", | |
ResourcePath = null, | |
IgnoreResourcePathInResources = null, | |
EmbedResources = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetZipWithPages(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when archiving document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageGetZipWithPagesRequest | |
{ | |
FileName = "one-pagetest.docx", | |
Format = null, | |
Width = null, | |
Height = null, | |
Quality = null, | |
StartPageNumber = null, | |
CountPages = null, | |
Password = null, | |
ExtractText = null, | |
RenderComments = null, | |
RenderHiddenPages = null, | |
DefaultFontName = null, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageGetZipWithPages(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when archiving document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Move File | |
class Move_File | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FileApi(configuration); | |
try | |
{ | |
var request = new MoveFileRequest("viewerdocs/one-page1.docx", "viewerdocs1/one-page1.docx", Common.MyStorage, Common.MyStorage); | |
apiInstance.MoveFile(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs/one-page1.docx' file moved to 'viewerdocs1/one-page1.docx'."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FileApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Move Folder | |
class Move_Folder | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FolderApi(configuration); | |
try | |
{ | |
var request = new MoveFolderRequest("viewerdocs1", "viewerdocs\viewerdocs1", Common.MyStorage, Common.MyStorage); | |
apiInstance.MoveFolder(request); | |
Console.WriteLine("Expected response type is Void: 'viewerdocs1' folder moved to 'viewerdocs/viewerdocs1'."); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FolderApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Is Object Exists | |
class Object_Exists | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new StorageApi(configuration); | |
try | |
{ | |
var request = new ObjectExistsRequest("viewerdocs/one-page.docx", Common.MyStorage); | |
var response = apiInstance.ObjectExists(request); | |
Console.WriteLine("Expected response type is ObjectExist: " + response.Exists.Value.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling StorageApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlGetPageResourceRequest | |
{ | |
FileName = "one-page.docx", | |
PageNumber = 1, | |
ResourceName = "styles.css", | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlGetPageResource(request); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when getting Page resource: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlDeletePagesCacheRequest | |
{ | |
Folder = null, | |
Storage = "First Storage", | |
}; | |
apiInstance.HtmlDeletePagesCache(request); | |
Debug.Print("Document Cache Removed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Removing Html Pages Cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageDeletePagesCacheRequest | |
{ | |
Folder = null, | |
Storage = "First Storage", | |
}; | |
apiInstance.ImageDeletePagesCache(request); | |
Debug.Print("Document Cache Removed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when Removing Image Pages Cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample.DXF", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
CadOptions = new CadOptions() | |
{ | |
Tiles = new List<Tile>() { | |
new Tile() { Height = 800, StartPointX = 0, StartPointY = 0, Width = 1300 }, | |
new Tile() { Height = 800, StartPointX = 1300, StartPointY = 0, Width = 1300 }, | |
new Tile() { Height = 800, StartPointX = 0, StartPointY = 800, Width = 1300 }, | |
new Tile() { Height = 800, StartPointX = 1300, StartPointY = 800, Width = 1300 } | |
} | |
} | |
} | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Console.WriteLine("File name:" + response.FileName); | |
Console.WriteLine("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
Folder = "viewerdocs", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions() | |
{ | |
EmailOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.EmailOptions() | |
{ | |
FieldLabels = new List<FieldLabel>() { new FieldLabel() { Field = "From", Label = "Sender" }, new FieldLabel() { Field = "To", Label = "Receiver" } } | |
} | |
} | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePagesCacheRequest | |
{ | |
FileName = "with-attachment.msg", | |
Folder = "viewerdocs", | |
ImageOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ImageOptions() | |
{ | |
EmailOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.EmailOptions() | |
{ | |
PageSize = "A0" | |
} | |
} | |
}; | |
var response = apiInstance.ImageCreatePagesCache(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("Pages: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageCreatePdfFileRequest | |
{ | |
FileName = "with-attachment.msg", | |
Folder = "viewerdocs", | |
PdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions() | |
{ | |
EmailOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.EmailOptions() | |
{ | |
PageSize = "A0" | |
} | |
} | |
}; | |
var response = apiInstance.ImageCreatePdfFile(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PdfFileName: " + response.PdfFileName); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting pdf document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var file = "data.pst"; | |
var htmlOptions = new HtmlOptions | |
{ | |
EmbedResources = true, | |
OutlookOptions = new OutlookOptions | |
{ | |
MaxItemsInFolder = 5 | |
} | |
}; | |
var request = new HtmlCreatePagesCacheFromContentRequest | |
{ | |
HtmlOptions = this.SerializeObject(htmlOptions), | |
File = this.GetTestFileStream(file), | |
FileName = null, | |
FontsFolder = null, | |
Folder = FromContentFolder, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCacheFromContent(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration("XXXX-XXXX-XXX", "XXXXXXXXXX"); | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePdfFileRequest | |
{ | |
FileName = "sample2.pdf", | |
PdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions | |
{ | |
DefaultFontName = "Arial" | |
} | |
}; | |
var response = apiInstance.HtmlCreatePdfFile(request); | |
Console.WriteLine("File name:" + response.FileName); | |
Console.WriteLine("PdfFileName: " + response.PdfFileName); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when creating pdf document: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "xxxx", | |
AppKey = "xxxx-xx" | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "with-overflowed-text.xlsx", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions() | |
{ | |
CellsOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.CellsOptions() | |
{ | |
RenderPrintAreaOnly = true, | |
RenderGridLines = true | |
} | |
} | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample.mpp", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions | |
{ | |
EmbedResources = true, | |
ProjectOptions = new ProjectOptions() { | |
TimeUnit = "Days", | |
StartDate = new DateTime(2008, 7, 1), | |
EndDate = new DateTime(2008, 7, 31) | |
} | |
}, | |
FontsFolder = null, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Debug.Print("File name:" + response.FileName); | |
Debug.Print("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception when creating pages cache: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlTransformPagesRequest | |
{ | |
FileName = "four-pages.docx", | |
TransformOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ReorderOptions | |
{ | |
PageNumber = 1, | |
NewPosition = 2 | |
}, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlTransformPages(request); | |
Debug.Print("First Page order:" + response.Pages[0].Number); | |
Debug.Print("Second Page order:" + response.Pages[1].Number); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while reordering document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageTransformPagesRequest | |
{ | |
FileName = "four-pages.docx", | |
TransformOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.ReorderOptions | |
{ | |
PageNumber = 1, | |
NewPosition = 2 | |
}, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageTransformPages(request); | |
Debug.Print("First Page order:" + response.Pages[0].Number); | |
Debug.Print("Second Page order:" + response.Pages[1].Number); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while reordering document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlTransformPagesRequest | |
{ | |
FileName = "four-pages.docx", | |
TransformOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.RotateOptions | |
{ | |
PageNumber = 1, | |
Angle = 90 | |
}, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.HtmlTransformPages(request); | |
Debug.Print("First Page angle:" + response.Pages[0].Angle); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while rotating document page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = Sid, | |
AppKey = Key | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new ImageTransformPagesRequest | |
{ | |
FileName = "four-pages.docx", | |
TransformOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.RotateOptions | |
{ | |
PageNumber = 1, | |
Angle = 90 | |
}, | |
Folder = null, | |
Storage = null, | |
}; | |
var response = apiInstance.ImageTransformPages(request); | |
Debug.Print("First Page angle:" + response.Pages[0].Angle); | |
Debug.Print("Document Processed"); | |
} | |
catch (Exception e) | |
{ | |
Debug.Print("Exception while rotating document page: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
class RunExamples | |
{ | |
static void Main(string[] args) | |
{ | |
//// *********************************************************** | |
//// GroupDocs.Viewer Cloud API Examples | |
//// *********************************************************** | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
Common.MyAppSid = "XXXXX-XXXXX-XXXXX"; | |
Common.MyAppKey = "XXXXXXXXXX"; | |
Common.MyStorage = "XXXXX"; | |
// Uploading sample test files from local to storage under folder 'viewerdocs' | |
//Common.UploadSampleTestFiles(); | |
//// *********************************************************** | |
///// ***** WORKING WITH STORAGE ***** | |
//// *********************************************************** | |
// Is Storage Exist | |
//Storage_Exist.Run(); | |
// Get Get Disc Usage | |
//Get_Disc_Usage.Run(); | |
// Get File Versions | |
//Get_File_Versions.Run(); | |
// Is Object Exists | |
//Object_Exists.Run(); | |
//// *********************************************************** | |
//// ***** WORKING WITH FOLDER ***** | |
//// *********************************************************** | |
// Create Folder | |
//Create_Folder.Run(); | |
// Copy Folder | |
//Copy_Folder.Run(); | |
// Move Folder | |
//Move_Folder.Run(); | |
// Delete Folder | |
//Delete_Folder.Run(); | |
// Get Files List | |
//Get_Files_List.Run(); | |
//// *********************************************************** | |
//// ***** WORKING WITH FILES ***** | |
//// *********************************************************** | |
// Upload File | |
//Upload_File.Run(); | |
// Copy File | |
//Copy_File.Run(); | |
// Move File | |
//Move_File.Run(); | |
// Delete File | |
//Delete_File.Run(); | |
// Download_File | |
//Download_File.Run(); | |
//// *********************************************************** | |
//// ***** WORKING WITH SUPPORTED FORMATS ***** | |
//// *********************************************************** | |
// Get All Supported Formats | |
Get_All_Supported_Formats.Run(); | |
//// *********************************************************** | |
//// ***** WORKING WITH VIEW ***** | |
//// *********************************************************** | |
// Create View With Minimal & Default ViewFormat & ViewOptions | |
//Create_View_With_Minimal_ViewOptions.Run(); | |
// Create View With HTML View Format | |
//Create_View_With_HTML_View_Format.Run(); | |
// Create View With Image View Format | |
//Create_View_With_Image_View_Format.Run(Sdk.Model.ViewOptions.ViewFormatEnum.JPG); | |
// Create View With Render Hidden Pages | |
//Create_View_With_Render_Hidden_Pages.Run(); | |
// Create View With Spreadsheet Options | |
//Create_View_With_SpreadsheetOptions.Run(); | |
// Create View With Spreadsheet Render Hidden Rows | |
//Create_View_With_Spreadsheet_Render_Hidden_Rows_Option.Run(); | |
// Create View With Spreadsheet Options | |
//Create_View_With_SpreadsheetOptions.Run(); | |
// Create View With Project Options | |
//Create_View_With_Project_Options.Run(); | |
// Create View With Fonts Path Options | |
//Create_View_With_Fonts_Path_Options.Run(); | |
// Create View With Start Page & To Count Pages | |
//Create_View_With_StartPage_And_CountPages.Run(); | |
// Create View With HTML ViewOptions | |
//Create_View_With_HTML_ViewOptions.Run(); | |
// Delete View With Default ViewFormat | |
//Delete_View_With_Default_ViewFormat.Run(); | |
// Create View With Responsive HTML & ViewOptions | |
//Create_View_With_Responsive_HTML.Run(); | |
// Create View With Output Path & ViewOptions | |
//Create_View_With_OutputPath.Run(); | |
//// *********************************************************** | |
/////// ***** WORKING WITH DOCUMENT INFORMATION ***** | |
//// *********************************************************** | |
// Get Document Information With Minimal ViewOptions | |
//Get_Info_With_Minimal_ViewOptions.Run(); | |
// Get Document Information With HTML View Format | |
//Get_Info_With_HTML_View_Format.Run(); | |
// Get Document Information With Image View Format | |
//Get_Info_With_Image_View_Format.Run(Sdk.Model.ViewOptions.ViewFormatEnum.PNG); | |
// Get Document Information With Render Hidden Pages | |
//Get_Info_With_Render_Hidden_Pages.Run(); | |
// Get Document Information With Spreadsheet Options | |
//Get_Info_With_SpreadsheetOptions.Run(); | |
// Get Document Information With Spreadsheet Render Hidden Rows | |
//Get_Info_With_Spreadsheet_Render_Hidden_Rows_Option.Run(); | |
// Get Document Information With CAD Options | |
//Get_Info_With_CAD_Options.Run(); | |
// Get Document Information With Project Options | |
//Get_Info_With_Project_Options.Run(); | |
// Get Document Information With Image View Options | |
//Get_Info_With_Image_View_Options_Options.Run(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "xxxx", | |
AppKey = "xxxx-xx" | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "sample2.pdf", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions() | |
{ | |
PdfOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfOptions() | |
{ | |
ImageQuality = "High" | |
} | |
} | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
private static string Sign(string url, string appKey) | |
{ | |
UriBuilder uriBuilder = new UriBuilder(url); | |
// Remove final slash here as it can be added automatically. | |
uriBuilder.Path = uriBuilder.Path.TrimEnd('/'); | |
// Compute the hash. | |
byte[] privateKey = Encoding.UTF8.GetBytes(appKey); | |
System.Security.Cryptography.HMACSHA1 algorithm = new System.Security.Cryptography.HMACSHA1(privateKey); | |
byte[] sequence = ASCIIEncoding.ASCII.GetBytes(uriBuilder.Uri.AbsoluteUri); | |
byte[] hash = algorithm.ComputeHash(sequence); | |
string signature = Convert.ToBase64String(hash); | |
// Remove invalid symbols. | |
signature = signature.TrimEnd('='); | |
signature = HttpUtility.UrlEncode(signature); | |
// Convert codes to upper case as they can be updated automatically. | |
signature = System.Text.RegularExpressions.Regex.Replace(signature, "%[0-9a-f]{2}", e => e.Value.ToUpper()); | |
// Add the signature to query string. | |
return string.Format("{0}&signature={1}", uriBuilder.Uri.AbsoluteUri, signature); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Is Storage Exist | |
class Storage_Exist | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new StorageApi(configuration); | |
try | |
{ | |
var request = new StorageExistsRequest(Common.MyStorage); | |
var response = apiInstance.StorageExists(request); | |
Console.WriteLine("Expected response type is StorageExist: " + response.Exists.Value.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling StorageApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "xxxx", | |
AppKey = "xxxx-xx" | |
}; | |
var apiInstance = new ViewerApi(configuration); | |
try | |
{ | |
var request = new HtmlCreatePagesCacheRequest | |
{ | |
FileName = "with-overflowed-text.xlsx", | |
HtmlOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.HtmlOptions() | |
{ | |
CellsOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.CellsOptions() | |
{ | |
TextOverflowMode = "AutoFitColumn" | |
} | |
} | |
}; | |
var response = apiInstance.HtmlCreatePagesCache(request); | |
Console.Write("File name:" + response.FileName); | |
Console.Write("PageCount: " + response.Pages.Count); | |
} | |
catch (Exception e) | |
{ | |
Console.Write("Exception when getting document pages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests; | |
using System; | |
using System.IO; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
// Upload File | |
class Upload_File | |
{ | |
public static void Run() | |
{ | |
var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey); | |
var apiInstance = new FileApi(configuration); | |
try | |
{ | |
// Open file in IOStream from local/disc. | |
var fileStream = File.Open("..\\..\\..\\Data\\viewerdocs\\one-page.docx", FileMode.Open); | |
var request = new UploadFileRequest("viewerdocs/one-page1.docx", fileStream, Common.MyStorage); | |
var response = apiInstance.UploadFile(request); | |
Console.WriteLine("Expected response type is FilesUploadResult: " + response.Uploaded.Count.ToString()); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception while calling FileApi: " + e.Message); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System; | |
using GroupDocs.Viewer.Cloud.Sdk.Client; | |
using GroupDocs.Viewer.Cloud.Sdk.Api; | |
namespace GroupDocs.Viewer.Cloud.Examples.CSharp | |
{ | |
class Common | |
{ | |
public static string MyAppSid = Common.MyAppSid; | |
public static string MyAppKey = Common.MyAppKey; | |
public static string MyStorage = Common.MyStorage; | |
public static void UploadSampleTestFiles() | |
{ | |
var storageConfig = new Configuration(MyAppSid, MyAppKey); | |
StorageApi storageApi = new StorageApi(storageConfig); | |
FolderApi folderApi = new FolderApi(storageConfig); | |
FileApi fileApi = new FileApi(storageConfig); | |
var path = "..\\..\\..\\Data"; | |
Console.WriteLine("File Upload Processing..."); | |
var dirs = Directory.GetDirectories(path, "*", SearchOption.AllDirectories); | |
foreach (var dir in dirs) | |
{ | |
var relativeDirPath = dir.Replace(path, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var response = storageApi.ObjectExists(new Sdk.Model.Requests.ObjectExistsRequest(relativeDirPath, MyStorage)); | |
if (!response.Exists.Value) | |
{ | |
folderApi.CreateFolder(new Sdk.Model.Requests.CreateFolderRequest(relativeDirPath, MyStorage)); | |
} | |
} | |
var files = Directory.GetFiles(path, "*", SearchOption.AllDirectories); | |
foreach (var file in files) | |
{ | |
var relativeFilePath = file.Replace(path, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var response = storageApi.ObjectExists(new Sdk.Model.Requests.ObjectExistsRequest(relativeFilePath, MyStorage)); | |
if (!response.Exists.Value) | |
{ | |
var fileName = Path.GetFileName(file); | |
var relativeDirPath = relativeFilePath.Replace(fileName, string.Empty).Trim(Path.DirectorySeparatorChar); | |
var fileStream = File.Open(file, FileMode.Open); | |
fileApi.UploadFile(new Sdk.Model.Requests.UploadFileRequest(relativeFilePath, fileStream, MyStorage)); | |
fileStream.Close(); | |
} | |
} | |
Console.WriteLine("File Upload Process Completed."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment