Skip to content

Instantly share code, notes, and snippets.

@aspose-pdf
Last active August 16, 2018 15:49
Show Gist options
  • Save aspose-pdf/12c062ac4f2dfa4cd833a5227405bb99 to your computer and use it in GitHub Desktop.
Save aspose-pdf/12c062ac4f2dfa4cd833a5227405bb99 to your computer and use it in GitHub Desktop.
This Gist contains .NET code snippets for examples of Aspose.Pdf for Cloud SDK.
Aspose-Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get all annotations from pdf page
AnnotationsResponse apiResponse = pdfApi.GetPageAnnotations(fileName, pageNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (Link annotatonLink in apiResponse.Annotations.Links)
{
Console.WriteLine("Annotation Link :: " + annotatonLink.Href);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get annotations count from Pdf page
AnnotationsResponse apiResponse = pdfApi.GetPageAnnotations(fileName, pageNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
int count = apiResponse.Annotations.Links.Count;
Console.WriteLine("Annotation Count :: " + count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
int pageNumber = 1;
int annotationNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get specific annotation from pdf page
AnnotationResponse apiResponse = pdfApi.GetPageAnnotation(fileName, pageNumber, annotationNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Annotation annotation = apiResponse.Annotation;
Console.WriteLine("Annotation Content" + annotation.Contents);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleAttachment";
String fileName = name + ".pdf";
int attachmentIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to download specific attachment from a pdf
ResponseMessage apiResponse = pdfApi.GetDownloadDocumentAttachmentByIndex(fileName, attachmentIndex, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Download a specific Attachment from a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "SampleAttachment.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get all attachments from a pdf
AttachmentsResponse apiResponse = pdfApi.GetDocumentAttachments(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Get all Attachments from a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "SampleAttachment.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get attachment count from a pdf
AttachmentsResponse apiResponse = pdfApi.GetDocumentAttachments(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Com.Aspose.PDF.Model.Attachments attachments = apiResponse.Attachments;
int count = attachments.List.Count;
Console.WriteLine("Count :: " + count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleAttachment";
String fileName = name + ".pdf";
int attachmentIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get specific attachment from a pdf
AttachmentResponse apiResponse = pdfApi.GetDocumentAttachmentByIndex(fileName, attachmentIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Attachment attach = apiResponse.Attachment;
Console.WriteLine("Name :: " + attach.Name);
Console.WriteLine("MimeType :: " + attach.MimeType);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Bookmark.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get all bookmarks from pdf
BookmarksResponse apiResponse = pdfApi.GetDocumentBookmarks(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Com.Aspose.PDF.Model.Bookmarks bookmarks = apiResponse.Bookmarks;
Console.WriteLine("Get all Bookmarks from a PDF,Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Bookmark.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get bookmark count from pdf
BookmarksResponse apiResponse = pdfApi.GetDocumentBookmarks(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Com.Aspose.PDF.Model.Bookmarks bookmarks = apiResponse.Bookmarks;
int count = bookmarks.List.Count;
Console.WriteLine("Bookmark Count :: " + count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Sample-Bookmark.pdf";
string bookmarkPath = null;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get bookmarks children
ResponseMessage apiResponse = pdfApi.GetDocumentBookmarksChildren(fileName, bookmarkPath, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Get Bookmarks Children from a PDF,Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Bookmark.pdf";
String bookmarkPath = "1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get specific bookmark
ResponseMessage apiResponse = pdfApi.GetDocumentBookmarksChildren(fileName, bookmarkPath, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Get Specific Bookmark from a PDF,Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample.pdf";
String appendFile = null;
int startPage = 2;
int endPage = 3;
String storage = "";
String folder = "";
String appendFileName = "sample-input.pdf";
AppendDocument body = new AppendDocument();
body.Document = appendFileName;
body.StartPage = 2;
body.EndPage = 3;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(appendFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + appendFileName));
// Invoke Aspose.PDF Cloud SDK API to append pdf file
DocumentResponse apiResponse = pdfApi.PostAppendDocument(fileName, appendFile, startPage, endPage, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Append PDF Files, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample.pdf";
String format = "html";
String storage = "";
String folder = "";
String outPath = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to convert pdf to images
ResponseMessage apiResponse = pdfApi.GetDocumentWithFormat(fileName, format, storage, folder, "outFile");
if (apiResponse != null)
{
Console.WriteLine("Convert PDF to TIFF, Done!");
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "123";
String fileName = name + ".pdf";
String format = "TIFF";
String url = "https://github.com/farooqsheikhpk/Aspose_Pdf_Cloud/raw/master/SDKs/Aspose.Pdf_Cloud_SDK_for_Java/src/test/resources/" + fileName;
String outPath = "";
byte[] file = null; //System.IO.File.ReadAllBytes("\\temp\\pdf\\resources\\" + fileName);
try
{
ResponseMessage apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file);
if (apiResponse != null)
{
Console.WriteLine("Convert PDF from Remote Server to TIFF, Done!");
}
format = "DOC";
// Invoke Aspose.PDF Cloud SDK API to pdf file to doc format
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file);
if (apiResponse != null)
{
Console.WriteLine("Convert PDF from Remote Server to DOC, Done!");
}
format = "HTML";
// Invoke Aspose.PDF Cloud SDK API to convert pdf to HTML format
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file);
if (apiResponse != null)
{
Console.WriteLine("Convert PDF from Remote Server to HTML, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("ERROR:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample.pdf";
String format = "html";
String url = "";
String outPath = "";
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName);
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to convert pdf to other formats
ResponseMessage apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "input.pdf";
String templateFile = "";
String dataFile = "";
String templateType = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate( fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to create empty pdf file
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Create Empty PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample.pdf";
String templateFile = "Sample.html";
String dataFile = "";
String templateType = "html";
String storage = "";
String folder = "";
try
{
// Upload source files to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Invoke Aspose.PDF Cloud SDK API to create pdf file from HTML
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
// Download created pdf file
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName,null, storage);
// Save response stream to a file
System.IO.File.WriteAllBytes(Common.GetDataDir() + "Sample_out.pdf", storageRes.ResponseStream);
Console.WriteLine("Create PDF from HTML, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "input_out.pdf";
String templateFile = "sample.xsl";
String dataFile = "sample.xml";
String templateType = "xml";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
storageApi.PutCreate(dataFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + dataFile));
// Invoke Aspose.PDF Cloud SDK API to create Pdf from XML
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
// Download created pdf file
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
// Save response stream to a file
System.IO.File.WriteAllBytes(Common.GetDataDir() + "input_out.pdf", storageRes.ResponseStream);
Console.WriteLine("Create PDF from XML, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-jpeg.pdf";
String templateFile = "Einstein_JPEG.jpg";
String dataFile = "";
String templateType = "jpeg";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Invoke Aspose.PDF Cloud SDK API to create pdf from JPEG
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Create PDF from JPEG, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-svg.pdf";
String templateFile = "Sample.epub";
String dataFile = "";
String templateType = "epub";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Invoke Aspose.PDF Cloud SDK API to create pdf from SVG
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Create PDF from SVG, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-tiff.pdf";
String templateFile = "Sample.tiff";
String dataFile = "";
String templateType = "tiff";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Invoke Aspose.PDF Cloud SDK API to create pdf from TIFF
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Create PDF from TIFF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-merged.pdf";
String storage = "";
String folder = "";
MergeDocuments body = new MergeDocuments();
body.List = new System.Collections.Generic.List<string> { "sample.pdf", "input.pdf" };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate("sample.pdf", "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + "sample.pdf"));
storageApi.PutCreate("input.pdf", "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + "input.pdf"));
// Invoke Aspose.PDF Cloud SDK API to merge pdf files
DocumentResponse apiResponse = pdfApi.PutMergeDocuments(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Merge Multiple PDF Files, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get all document properies
DocumentPropertiesResponse apiResponse = pdfApi.GetDocumentProperties(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (DocumentProperty docProp in apiResponse.DocumentProperties.List)
{
Console.WriteLine(docProp.Name + " :: " + docProp.Value);
}
Console.WriteLine("Get All Document Properties from a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
String propertyName = "Creator";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get particular document property
DocumentPropertyResponse apiResponse = pdfApi.GetDocumentProperty(fileName, propertyName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
DocumentProperty docProp = apiResponse.DocumentProperty;
Console.WriteLine(docProp.Name + " :: " + docProp.Value);
Console.WriteLine("Get a Particular Document Property from a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to remove all document properties
SaaSposeResponse apiResponse = pdfApi.DeleteProperties(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Remove All Document Properties from a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample-Annotation.pdf";
String propertyName = "author";
String storage = "";
String folder = "";
DocumentProperty body = new DocumentProperty();
body.Name = "author";
body.Value = "Naeem Akram";
body.BuiltIn = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to set single pdf document property
DocumentPropertyResponse apiResponse = pdfApi.PutSetProperty(fileName, propertyName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
DocumentProperty docProp = apiResponse.DocumentProperty;
Console.WriteLine(docProp.Name + " :: " + docProp.Value);
Console.WriteLine("Set a Single Document Property in a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.TextReplace body = new Com.Aspose.PDF.Model.TextReplace();
body.OldValue = "Sample PDF";
body.NewValue = "This is the new test added by IA";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate( fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace pdf text
DocumentTextReplaceResponse apiResponse = pdfApi.PostDocumentReplaceText(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace PDF Document Text, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.TextReplaceListRequest body = new Com.Aspose.PDF.Model.TextReplaceListRequest();
Com.Aspose.PDF.Model.TextReplace tr = new Com.Aspose.PDF.Model.TextReplace();
tr.NewValue = "This will be the new text";
body.TextReplaces = new System.Collections.Generic.List<Com.Aspose.PDF.Model.TextReplace> { tr };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate( fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace pdf text list
DocumentTextReplaceResponse apiResponse = pdfApi.PostDocumentReplaceTextList(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace PDF Document Text List, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input-2.pdf";
String signatureFileName = "pkc7-sample.pfx";
String storage = "";
String folder = "";
Signature body = new Signature();
body.Authority = "Farooq Sheikh";
body.Location = "Gojra";
body.Contact = "naeem.akram@aspose.com";
body.Date = "06/20/2017 2:00:00.000 AM";
body.FormFieldName = "Signature1";
body.Password = "aspose";
Rectangle rect = new Rectangle();
rect.X = 100;
rect.Y = 100;
rect.Height = 100;
rect.Width = 200;
body.Rectangle = rect;
body.SignaturePath = signatureFileName;
body.SignatureType = "PKCS7";
body.Visible = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(signatureFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + signatureFileName));
// Invoke Aspose.PDF Cloud SDK API to sign Pdf document
SaaSposeResponse apiResponse = pdfApi.PostSignDocument(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
// Download created pdf file
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
// Save response stream to a file
System.IO.File.WriteAllBytes(Common.GetDataDir() + "SignPdfDoc_out.pdf", storageRes.ResponseStream);
Console.WriteLine("Sign PDF Documents, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "input.pdf";
String format = "pdf";
int from = 1;
int to = 2;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to split pdf files
SplitResultResponse apiResponse = pdfApi.PostSplitDocument(fileName, format, from, to, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Split PDF Files, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
int? page = 1;
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.Field body = new Com.Aspose.PDF.Model.Field();
Com.Aspose.PDF.Model.Link link = new Com.Aspose.PDF.Model.Link();
link.Href = "http://api.aspose.cloud/v1.1/pdf/ABFillablewfields.pdf/fields/NewField";
link.Rel = "self";
link.Title = "NewField";
link.Type = "link";
Com.Aspose.PDF.Model.Rectangle rect = new Com.Aspose.PDF.Model.Rectangle();
rect.X = 0;
rect.Y = 0;
body.Name = "dvDate_1";
body.Values = new System.Collections.Generic.List<string> { "NewFieldValue" };
body.Rect = rect;
body.SelectedItems = new System.Collections.Generic.List<int?> { 1 };
body.Type = 0;
body.Links = new System.Collections.Generic.List<Com.Aspose.PDF.Model.Link> { link };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to create form field
SaaSposeResponse apiResponse = pdfApi.PostCreateField(fileName, page, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Create a Form Field in a PDF Document, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
int? page = 1;
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.Field body = new Com.Aspose.PDF.Model.Field();
Com.Aspose.PDF.Model.Link link = new Com.Aspose.PDF.Model.Link();
link.Href = "http://api.aspose.cloud/v1.1/pdf/ABFillablewfields.pdf/fields/NewField";
link.Rel = "self";
Com.Aspose.PDF.Model.Rectangle rect = new Com.Aspose.PDF.Model.Rectangle();
rect.X = 100;
rect.Y = 100;
body.Rect = rect;
body.Name = "Signature1";
body.Values = new System.Collections.Generic.List<string> { ""};
body.Type = 0;
body.Links = new System.Collections.Generic.List<Com.Aspose.PDF.Model.Link> { link };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to create form field
SaaSposeResponse apiResponse = pdfApi.PostCreateField(fileName, page, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
// Download created pdf file
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null);
// Save response stream to a file
System.IO.File.WriteAllBytes(Common.GetDataDir() + "SignatureField.pdf", storageRes.ResponseStream);
Console.WriteLine("Create a Form Field in a PDF Document, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input-2.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get all fields from pdf document
FieldsResponse apiResponse = pdfApi.GetFields(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (Field field in apiResponse.Fields.List)
{
Console.WriteLine("Name: " + field.Name + "Type: " + field.Type);
}
Console.WriteLine("Get all Form Fields from the PDF Document, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-field.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get field count
FieldsResponse apiResponse = pdfApi.GetFields(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
int count = apiResponse.Fields.List.Count;
Console.WriteLine("Count" + count);
Console.WriteLine("Get Form Field Count from a PDF Document, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-field.pdf";
String fieldName = "textbox1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get particular field
FieldResponse apiResponse = pdfApi.GetField(fileName, fieldName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Field field = apiResponse.Field;
Console.WriteLine("Name" + field.Name);
Console.WriteLine("Value" + field.Values[0]);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-field.pdf";
String fieldName = "textbox1";
String storage = "";
String folder = "";
Field body = new Field();
body.Name = "textbox1";
body.Values = new List<string> { "Aspose" };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to update form field
FieldResponse apiResponse = pdfApi.PutUpdateField(fileName, storage, folder, fieldName, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Field field = apiResponse.Field;
Console.WriteLine("Name" + field.Name);
Console.WriteLine("Value" + field.Values[0]);
Console.WriteLine("Update a Form Field in a PDF Document, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleImage";
String fileName = name + ".pdf";
int pageNumber = 1;
int imageNumber = 1;
String format = "jpeg";
int? width = null;
int? height = null;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to extract particular image with default size
ResponseMessage apiResponse = pdfApi.GetImageWithFormat(fileName, pageNumber, imageNumber, format, width, height, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Extract a Particular Image from a PDF Page with Default Size, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleImage";
String fileName = name + ".pdf";
int pageNumber = 1;
int imageNumber = 1;
String format = "jpeg";
int? width = 200;
int? height = 200;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to extract particular image with specified size
ResponseMessage apiResponse = pdfApi.GetImageWithFormat(fileName, pageNumber, imageNumber, format, width, height, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Extract a Particular Image from a PDF Page with Specified Size, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "SampleImage.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get image count
ImagesResponse apiResponse = pdfApi.GetImages(fileName, pageNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
int count = apiResponse.Images.List.Count;
Console.WriteLine("Image Count " + count);
Console.WriteLine("Get Image Count from a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Lenovo_Tablet_2_Datasheet.pdf";
int? pageNumber = 1;
int? imageNumber = 1;
string format = "jpeg";
int? width = 0;
int? height = 0;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get image with format
ResponseMessage apiResponse = pdfApi.GetImageWithFormat(fileName, pageNumber, imageNumber, format, width, height, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("Ok"))
{
Console.WriteLine("Get Image with Format, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleImage";
String fileName = name + ".pdf";
int pageNumber = 1;
int imageNumber = 1;
String imageFile = "aspose-cloud.png";
String storage = "";
String folder = "";
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile);
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace image using image file
ImageResponse apiResponse = pdfApi.PostReplaceImage(fileName, pageNumber, imageNumber, imageFile, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Image in a PDF File using Image File, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "SampleImage";
String fileName = name + ".pdf";
int pageNumber = 1;
int imageNumber = 1;
String imageFile = "aspose-cloud.png";
String storage = "";
String folder = "";
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile);
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace image using local image stream
ImageResponse apiResponse = pdfApi.PostReplaceImage(fileName, pageNumber, imageNumber, imageFile, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Image in a PDF file using Local Image Stream, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to add new page
DocumentPagesResponse apiResponse = pdfApi.PutAddNewPage(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add a New Page in PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "sample-input";
String fileName = name + ".pdf";
int pageNumber = 1;
String format = "jpeg";
int? width = null;
int? height = null;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to convert pdf page to image with defualt size
ResponseMessage apiResponse = pdfApi.GetPageWithFormat(fileName, pageNumber, format, width, height, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert a PDF Page to Image with Default Size, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "sample-input";
String fileName = name + ".pdf";
int pageNumber = 1;
String format = "jpeg";
int width = 300;
int height = 300;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to convert pdf page to image with specified size
ResponseMessage apiResponse = pdfApi.GetPageWithFormat(fileName, pageNumber, format, width, height, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert a PDF Page to Image with Specified Size, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to delete page from Pdf
SaaSposeResponse apiResponse = pdfApi.DeletePage(fileName, pageNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Page from PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get page count from pdf document
DocumentPagesResponse apiResponse = pdfApi.GetPages(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
int count = apiResponse.Pages.List.Count;
Console.WriteLine("Total Page Count :: " + count);
Console.WriteLine("Get PDF Document Page Count, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int? pageNumber = 1;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get page informations
ResponseMessage apiResponse = pdfApi.GetPage(fileName, pageNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("Ok"))
{
Console.WriteLine("Get PDF Document Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get words count per page from pdf document
WordCountResponse apiResponse = pdfApi.GetWordsPerPage(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (PageWordCount PageWordCount in apiResponse.WordsPerPage.List)
{
Console.WriteLine("Page Number :: " + PageWordCount.PageNumber + " Total Words :: " + PageWordCount.Count);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-merged.pdf";
int pageNumber = 1;
int newIndex = 2;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to move pages to new location
SaaSposeResponse apiResponse = pdfApi.PostMovePage(fileName, pageNumber, newIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Move PDF Pages to New Locations in a PDF File, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
int? pageNumber = 1;
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.TextReplace body = new Com.Aspose.PDF.Model.TextReplace();
body.NewValue = "This is the latest text added by IA";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace pdf document page text
PageTextReplaceResponse apiResponse = pdfApi.PostPageReplaceText(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("PDF Document Page Replace Text, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "test.pdf";
int? pageNumber = 1;
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.TextReplaceListRequest body = new Com.Aspose.PDF.Model.TextReplaceListRequest();
Com.Aspose.PDF.Model.TextReplace tr = new Com.Aspose.PDF.Model.TextReplace();
tr.NewValue = "This will be the new text";
body.TextReplaces = new System.Collections.Generic.List<Com.Aspose.PDF.Model.TextReplace> { tr };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace pdf document page text list
PageTextReplaceResponse apiResponse = pdfApi.PostPageReplaceTextList(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("PDF Document Page Replace Text List, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "sample-input.pdf";
int? pageNumber = 1;
string storage = null;
string folder = null;
Com.Aspose.PDF.Model.Signature body = new Com.Aspose.PDF.Model.Signature();
body.Authority = "Authority";
body.Contact = "naeem.akram@aspose.com";
body.Date = "18-4-2016";
body.FormFieldName = "Signature1";
body.Location = "Gojra";
body.Password = "aspose";
Com.Aspose.PDF.Model.Rectangle rect = new Com.Aspose.PDF.Model.Rectangle();
rect.X = 100;
rect.Y = 100;
rect.Height = 100;
rect.Width = 200;
body.Rectangle = rect;
body.SignaturePath = "pkc7-sample.pfx";
body.SignatureType = "PKCS7";
body.Visible = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(body.SignaturePath, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + body.SignaturePath));
// Invoke Aspose.PDF Cloud SDK API to sign pdf page
SaaSposeResponse apiResponse = pdfApi.PostSignPage(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("Ok"))
{
Console.WriteLine("Sign PDF Document Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String withEmpty = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get fragment count from a pdf page
TextItemsResponse apiResponse = pdfApi.GetFragments(fileName, pageNumber, withEmpty, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Fragment Count :" + apiResponse.TextItems.List.Count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
int fragmentNumber = 1;
String withEmpty = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get segment count from a pdf fragment
TextItemsResponse apiResponse = pdfApi.GetSegments(fileName, pageNumber, fragmentNumber, withEmpty, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Fragment Count :" + apiResponse.TextItems.List.Count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
int fragmentNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get text format of pdf fragment
TextFormatResponse apiResponse = pdfApi.GetFragmentTextFormat(fileName, pageNumber, fragmentNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
TextFormat segTextFormat = apiResponse.TextFormat;
Console.WriteLine("Segment Font Name - " + segTextFormat.FontName);
Console.WriteLine("Segment Font Size - " + segTextFormat.FontSize.Value);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "segments.pdf";
int pageNumber = 1;
int fragmentNumber = 1;
int segmentNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get text format of particular segment
TextFormatResponse apiResponse = pdfApi.GetSegmentTextFormat(fileName, pageNumber, fragmentNumber, segmentNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
TextFormat segTextFormat = apiResponse.TextFormat;
Console.WriteLine("Segment Font Name - " + segTextFormat.FontName);
Console.WriteLine("Segment Font Size - " + segTextFormat.FontSize.Value);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String withEmpty = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get text items from pdf document
TextItemsResponse apiResponse = pdfApi.GetTextItems(fileName, withEmpty, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem textItem in apiResponse.TextItems.List)
{
Console.WriteLine("Text:" + textItem.Text);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String withEmpty = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get text items from pdf page
TextItemsResponse apiResponse = pdfApi.GetPageTextItems(fileName, pageNumber, withEmpty, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem textItem in apiResponse.TextItems.List)
{
Console.WriteLine("Text:" + textItem.Text);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
int fragmentNumber = 1;
String withEmpty = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to get text from particular fragment of pdf document
TextItemsResponse apiResponse = pdfApi.GetFragment(fileName, pageNumber, fragmentNumber, withEmpty, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem textItem in apiResponse.TextItems.List)
{
Console.WriteLine("Text:" + textItem.Text);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
TextReplaceListRequest body = new TextReplaceListRequest();
TextReplace tr1 = new TextReplace();
tr1.OldValue = "Sample";
tr1.NewValue = "Aspose Sample";
TextReplace tr2 = new TextReplace();
tr2.OldValue = "PDF";
tr2.NewValue = "PDF Document";
body.TextReplaces = new List<TextReplace> { tr1, tr2 };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace mutiple text in pdf page
PageTextReplaceResponse apiResponse = pdfApi.PostPageReplaceTextList(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Multiple Texts in a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String storage = "";
String folder = "";
TextReplaceListRequest body = new TextReplaceListRequest();
TextReplace tr1 = new TextReplace();
tr1.OldValue = "Sample";
tr1.NewValue = "Aspose Sample";
TextReplace tr2 = new TextReplace();
tr2.OldValue = "PDF";
tr2.NewValue = "PDF Document";
body.TextReplaces = new List<TextReplace> { tr1, tr2 };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace multiple text in PDF
DocumentTextReplaceResponse apiResponse = pdfApi.PostDocumentReplaceTextList(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Multiple Texts in a PDF, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String storage = "";
String folder = "";
TextReplace body = new TextReplace();
body.OldValue = "Sample PDF";
body.NewValue = "Sample Aspose PDF";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace text in a pdf file
DocumentTextReplaceResponse apiResponse = pdfApi.PostDocumentReplaceText(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Text in a PDF File, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
TextReplace body = new TextReplace();
body.OldValue = "Sample PDF";
body.NewValue = "Sample Aspose PDF";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to replace text in a pdf page
PageTextReplaceResponse apiResponse = pdfApi.PostPageReplaceText(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Replace Text in a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String imageFile = "aspose-cloud.png";
int pageNumber = 1;
String storage = "";
String folder = "";
Stamp body = new Stamp();
body.FileName = imageFile;
body.Background = true;
body.Type = "Image";
body.PageIndex = 0;
body.LeftMargin = 0.0;
body.Opacity = 0.5;
body.RightMargin = 0.0;
body.TopMargin = 0.0;
body.YIndent = 100.0;
body.XIndent = 100.0;
body.Zoom = 1.0;
body.TextState = null;
body.Width = 300.0;
body.Height = 300.0;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(imageFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile));
// Invoke Aspose.PDF Cloud SDK API to add image stamp to a pdf page
SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body);
if (apiResponse != null)
{
Console.WriteLine("Add Image Stamp (Watermark) to a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
Stamp body = new Stamp();
body.Background = true;
body.Value = "Page # of 2";
body.Type = "PageNumber";
body.PageIndex = 0;
body.LeftMargin = 0.0;
body.Opacity = 0.5;
body.RightMargin = 0.0;
body.TopMargin = 0.0;
body.YIndent = 100.0;
body.XIndent = 100.0;
body.Zoom = 1.0;
body.TextState = null;
body.Width = 300.0;
body.Height = 300.0;
body.StartingNumber = 1;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to add page number stamp to a pdf page
SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body);
if (apiResponse != null)
{
Console.WriteLine("Add Page Number Stamp to a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
String pdfName = "Sample.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
Stamp body = new Stamp();
body.FileName = pdfName;
body.Background = true;
body.Type = "Image";
body.PageIndex = 0;
body.LeftMargin = 0.0;
body.Opacity = 0.5;
body.RightMargin = 0.0;
body.TopMargin = 0.0;
body.YIndent = 100.0;
body.XIndent = 100.0;
body.Zoom = 1.0;
body.TextState = null;
body.Width = 300.0;
body.Height = 300.0;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(pdfName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + pdfName));
// Invoke Aspose.PDF Cloud SDK API to add pdf page as stamp to a pdf page
SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body);
if (apiResponse != null)
{
Console.WriteLine("Add PDF Page as Stamp (Watermark) to a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "sample-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
Stamp body = new Stamp();
body.Value = "Aspose.com";
body.Background = true;
body.Type = "Text";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.PDF Cloud SDK API to add text stamp to a pdf page
SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body);
if (apiResponse != null)
{
Console.WriteLine("Add Text Stamp (Watermark) to a PDF Page, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get all annotations from pdf page
Dim apiResponse As AnnotationsResponse = pdfApi.GetPageAnnotations(fileName, pageNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each annotatonLink As Link In apiResponse.Annotations.Links
Console.WriteLine("Annotation Link :: " + annotatonLink.Href)
Next
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get annotations count from Pdf page
Dim apiResponse As AnnotationsResponse = pdfApi.GetPageAnnotations(fileName, pageNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim count As Integer = apiResponse.Annotations.Links.Count
Console.WriteLine("Annotation Count :: " + count)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim pageNumber As Integer = 1
Dim annotationNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get specific annotation from pdf page
Dim apiResponse As AnnotationResponse = pdfApi.GetPageAnnotation(fileName, pageNumber, annotationNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim annotation As Annotation = apiResponse.Annotation
Console.WriteLine("Annotation Content" + annotation.Contents)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleAttachment"
Dim fileName As [String] = name + ".pdf"
Dim attachmentIndex As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to download specific attachment from a pdf
Dim apiResponse As ResponseMessage = pdfApi.GetDownloadDocumentAttachmentByIndex(fileName, attachmentIndex, storage, folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Download a specific Attachment from a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "SampleAttachment.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get all attachments from a pdf
Dim apiResponse As AttachmentsResponse = pdfApi.GetDocumentAttachments(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Get all Attachments from a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "SampleAttachment.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get attachment count from a pdf
Dim apiResponse As AttachmentsResponse = pdfApi.GetDocumentAttachments(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim attachments As Com.Aspose.PDF.Model.Attachments = apiResponse.Attachments
Dim count As Integer = attachments.List.Count
Console.WriteLine("Count :: " + count)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleAttachment"
Dim fileName As [String] = name + ".pdf"
Dim attachmentIndex As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get specific attachment from a pdf
Dim apiResponse As AttachmentResponse = pdfApi.GetDocumentAttachmentByIndex(fileName, attachmentIndex, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim attach As Attachment = apiResponse.Attachment
Console.WriteLine("Name :: " + attach.Name)
Console.WriteLine("MimeType :: " + attach.MimeType)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Bookmark.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get all bookmarks from pdf
Dim apiResponse As BookmarksResponse = pdfApi.GetDocumentBookmarks(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim bookmarks As Com.Aspose.PDF.Model.Bookmarks = apiResponse.Bookmarks
Console.WriteLine("Get all Bookmarks from a PDF,Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Bookmark.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get bookmark count from pdf
Dim apiResponse As BookmarksResponse = pdfApi.GetDocumentBookmarks(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim bookmarks As Com.Aspose.PDF.Model.Bookmarks = apiResponse.Bookmarks
Dim count As Integer = bookmarks.List.Count
Console.WriteLine("Bookmark Count :: " + count)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Bookmark.pdf"
Dim bookmarkPath As [String] = "1"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get specific bookmark
Dim apiResponse As ResponseMessage = pdfApi.GetDocumentBookmarksChildren(fileName, bookmarkPath, storage, folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Get Specific Bookmark from a PDF,Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample.pdf"
Dim appendFile As [String] = Nothing
Dim startPage As Integer = 2
Dim endPage As Integer = 3
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim appendFileName As [String] = "sample-input.pdf"
Dim body As New AppendDocument()
body.Document = appendFileName
body.StartPage = 2
body.EndPage = 3
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
storageApi.PutCreate(appendFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + appendFileName))
' Invoke Aspose.PDF Cloud SDK API to append pdf file
Dim apiResponse As DocumentResponse = pdfApi.PostAppendDocument(fileName, appendFile, startPage, endPage, storage, folder, _
body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Append PDF Files, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim format As [String] = "TIFF"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim outPath As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to convert pdf to images
Dim apiResponse As ResponseMessage = pdfApi.GetDocumentWithFormat(fileName, format, storage, folder, outPath)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF to TIFF, Done!")
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "123"
Dim fileName As [String] = name + ".pdf"
Dim format As [String] = "TIFF"
Dim url As [String] = "https://github.com/farooqsheikhpk/Aspose_Pdf_Cloud/raw/master/SDKs/Aspose.Pdf_Cloud_SDK_for_Java/src/test/resources/" + fileName
Dim outPath As [String] = ""
Dim file As Byte() = Nothing
'System.IO.File.ReadAllBytes("\\temp\\pdf\\resources\\" + fileName);
Try
Dim apiResponse As ResponseMessage = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF from Remote Server to TIFF, Done!")
End If
format = "DOC"
' Invoke Aspose.PDF Cloud SDK API to pdf file to doc format
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF from Remote Server to DOC, Done!")
End If
format = "HTML"
' Invoke Aspose.PDF Cloud SDK API to convert pdf to HTML format
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF from Remote Server to HTML, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("ERROR:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim format As [String] = "TIFF"
Dim url As [String] = ""
Dim outPath As [String] = ""
Dim file As Byte() = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to convert pdf to other formats
Dim apiResponse As ResponseMessage = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF to TIFF, Done!")
End If
format = "DOC"
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF to DOC, Done!")
End If
format = "html"
apiResponse = pdfApi.PutConvertDocument(format, url, outPath, file)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert PDF to HTML, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim templateFile As [String] = ""
Dim dataFile As [String] = ""
Dim templateType As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to create empty pdf file
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create Empty PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim templateFile As [String] = "sample.html"
Dim dataFile As [String] = ""
Dim templateType As [String] = "html"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile))
' Invoke Aspose.PDF Cloud SDK API to create pdf file from HTML
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create Empty HTML, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim templateFile As [String] = "sample.xsl"
Dim dataFile As [String] = "sample.xml"
Dim templateType As [String] = "xml"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile))
storageApi.PutCreate(dataFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + dataFile))
' Invoke Aspose.PDF Cloud SDK API to create Pdf from XML
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create PDF from XML, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-jpeg.pdf"
Dim templateFile As [String] = "Einstein_JPEG.jpg"
Dim dataFile As [String] = ""
Dim templateType As [String] = "jpeg"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile))
' Invoke Aspose.PDF Cloud SDK API to create pdf from JPEG
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create PDF from JPEG, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-svg.pdf"
Dim templateFile As [String] = "Example.svg"
Dim dataFile As [String] = ""
Dim templateType As [String] = "svg"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile))
' Invoke Aspose.PDF Cloud SDK API to create pdf from SVG
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create PDF from SVG, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-tiff.pdf"
Dim templateFile As [String] = "Sample.tiff"
Dim dataFile As [String] = ""
Dim templateType As [String] = "tiff"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile))
' Invoke Aspose.PDF Cloud SDK API to create pdf from TIFF
Dim apiResponse As DocumentResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Create PDF from TIFF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-merged.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New MergeDocuments()
body.List = New System.Collections.Generic.List(Of String)() From { _
"sample.pdf", _
"input.pdf" _
}
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate("sample.pdf", "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + "sample.pdf"))
storageApi.PutCreate("input.pdf", "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + "input.pdf"))
' Invoke Aspose.PDF Cloud SDK API to merge pdf files
Dim apiResponse As DocumentResponse = pdfApi.PutMergeDocuments(fileName, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Merge Multiple PDF Files, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get all document properies
Dim apiResponse As DocumentPropertiesResponse = pdfApi.GetDocumentProperties(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each docProp As DocumentProperty In apiResponse.DocumentProperties.List
Console.WriteLine(docProp.Name + " :: " + docProp.Value)
Next
Console.WriteLine("Get All Document Properties from a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim propertyName As [String] = "Creator"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get particular document property
Dim apiResponse As DocumentPropertyResponse = pdfApi.GetDocumentProperty(fileName, propertyName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim docProp As DocumentProperty = apiResponse.DocumentProperty
Console.WriteLine(docProp.Name + " :: " + docProp.Value)
Console.WriteLine("Get a Particular Document Property from a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to remove all document properties
Dim apiResponse As SaaSposeResponse = pdfApi.DeleteProperties(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Remove All Document Properties from a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "Sample-Annotation.pdf"
Dim propertyName As [String] = "author"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New DocumentProperty()
body.Name = "author"
body.Value = "Naeem Akram"
body.BuiltIn = True
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to set single pdf document property
Dim apiResponse As DocumentPropertyResponse = pdfApi.PutSetProperty(fileName, propertyName, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim docProp As DocumentProperty = apiResponse.DocumentProperty
Console.WriteLine(docProp.Name + " :: " + docProp.Value)
Console.WriteLine("Set a Single Document Property in a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim signatureFileName As [String] = "pkc7-sample.pfx"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Signature()
body.Authority = "Naeem Akram"
body.Location = "Gojra"
body.Contact = "naeem.akram@aspose.com"
body.[Date] = "06/24/2015 2:00:00.000 AM"
body.FormFieldName = "Signature1"
body.Password = "aspose"
Dim rect As New Rectangle()
rect.X = 100
rect.Y = 100
rect.Height = 100
rect.Width = 200
body.Rectangle = rect
body.SignaturePath = signatureFileName
body.SignatureType = "PKCS7"
body.Visible = True
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
storageApi.PutCreate(signatureFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + signatureFileName))
' Invoke Aspose.PDF Cloud SDK API to sign Pdf document
Dim apiResponse As SaaSposeResponse = pdfApi.PostSignPage(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Sign PDF Documents, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "input.pdf"
Dim format As [String] = "pdf"
Dim from As Integer = 1
Dim [to] As Integer = 2
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to split pdf files
Dim apiResponse As SplitResultResponse = pdfApi.PostSplitDocument(fileName, format, from, [to], storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Split PDF Files, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-field.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get all fields from pdf document
Dim apiResponse As FieldsResponse = pdfApi.GetFields(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each field As Field In apiResponse.Fields.List
Console.WriteLine("Name:" + field.Name)
Console.WriteLine("Value:" + field.Values(0))
Next
Console.WriteLine("Get all Form Fields from the PDF Document, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-field.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get field count
Dim apiResponse As FieldsResponse = pdfApi.GetFields(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim count As Integer = apiResponse.Fields.List.Count
Console.WriteLine("Count" + count)
Console.WriteLine("Get Form Field Count from a PDF Document, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-field.pdf"
Dim fieldName As [String] = "textbox1"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get particular field
Dim apiResponse As FieldResponse = pdfApi.GetField(fileName, fieldName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim field As Field = apiResponse.Field
Console.WriteLine("Name" + field.Name)
Console.WriteLine("Value" + field.Values(0))
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-field.pdf"
Dim fieldName As [String] = "textbox1"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Field()
body.Name = "textbox1"
body.Values = New List(Of String)() From { _
"Aspose" _
}
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to update form field
Dim apiResponse As FieldResponse = pdfApi.PutUpdateField(fileName, storage, folder, fieldName, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim field As Field = apiResponse.Field
Console.WriteLine("Name" + field.Name)
Console.WriteLine("Value" + field.Values(0))
Console.WriteLine("Update a Form Field in a PDF Document, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleImage"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim imageNumber As Integer = 1
Dim format As [String] = "jpeg"
Dim width As System.Nullable(Of Integer) = Nothing
Dim height As System.Nullable(Of Integer) = Nothing
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to extract particular image with default size
Dim apiResponse As ResponseMessage = pdfApi.GetImageWithFormat(fileName, pageNumber, imageNumber, format, width, height, _
storage, folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Extract a Particular Image from a PDF Page with Default Size, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleImage"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim imageNumber As Integer = 1
Dim format As [String] = "jpeg"
Dim width As System.Nullable(Of Integer) = 200
Dim height As System.Nullable(Of Integer) = 200
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to extract particular image with specified size
Dim apiResponse As ResponseMessage = pdfApi.GetImageWithFormat(fileName, pageNumber, imageNumber, format, width, height, _
storage, folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Extract a Particular Image from a PDF Page with Specified Size, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "SampleImage.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get image count
Dim apiResponse As ImagesResponse = pdfApi.GetImages(fileName, pageNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim count As Integer = apiResponse.Images.List.Count
Console.WriteLine("Image Count " + count)
Console.WriteLine("Get Image Count from a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleImage"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim imageNumber As Integer = 1
Dim imageFile As [String] = "aspose-cloud.png"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim file As Byte() = System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile)
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace image using image file
Dim apiResponse As ImageResponse = pdfApi.PostReplaceImage(fileName, pageNumber, imageNumber, imageFile, storage, folder, _
file)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Image in a PDF File using Image File, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "SampleImage"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim imageNumber As Integer = 1
Dim imageFile As [String] = "aspose-cloud.png"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim file As Byte() = System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile)
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace image using local image stream
Dim apiResponse As ImageResponse = pdfApi.PostReplaceImage(fileName, pageNumber, imageNumber, imageFile, storage, folder, _
file)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Image in a PDF file using Local Image Stream, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to add new page
Dim apiResponse As DocumentPagesResponse = pdfApi.PutAddNewPage(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Add a New Page in PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "sample-input"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim format As [String] = "jpeg"
Dim width As System.Nullable(Of Integer) = Nothing
Dim height As System.Nullable(Of Integer) = Nothing
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to convert pdf page to image with defualt size
Dim apiResponse As ResponseMessage = pdfApi.GetPageWithFormat(fileName, pageNumber, format, width, height, storage, _
folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert a PDF Page to Image with Default Size, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim name As [String] = "sample-input"
Dim fileName As [String] = name + ".pdf"
Dim pageNumber As Integer = 1
Dim format As [String] = "jpeg"
Dim width As Integer = 300
Dim height As Integer = 300
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to convert pdf page to image with specified size
Dim apiResponse As ResponseMessage = pdfApi.GetPageWithFormat(fileName, pageNumber, format, width, height, storage, _
folder)
If apiResponse IsNot Nothing Then
Console.WriteLine("Convert a PDF Page to Image with Specified Size, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to delete page from Pdf
Dim apiResponse As SaaSposeResponse = pdfApi.DeletePage(fileName, pageNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Delete Page from PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get page count from pdf document
Dim apiResponse As DocumentPagesResponse = pdfApi.GetPages(fileName, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim count As Integer = apiResponse.Pages.List.Count
Console.WriteLine("Total Page Count :: " + count)
Console.WriteLine("Get PDF Document Page Count, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-merged.pdf"
Dim pageNumber As Integer = 1
Dim newIndex As Integer = 2
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to move pages to new location
Dim apiResponse As SaaSposeResponse = pdfApi.PostMovePage(fileName, pageNumber, newIndex, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Move PDF Pages to New Locations in a PDF File, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim withEmpty As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get fragment count from a pdf page
Dim apiResponse As TextItemsResponse = pdfApi.GetFragments(fileName, pageNumber, withEmpty, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Fragment Count :" + apiResponse.TextItems.List.Count)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim fragmentNumber As Integer = 1
Dim withEmpty As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get segment count from a pdf fragment
Dim apiResponse As TextItemsResponse = pdfApi.GetSegments(fileName, pageNumber, fragmentNumber, withEmpty, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Fragment Count :" + apiResponse.TextItems.List.Count)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim fragmentNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get text format of pdf fragment
Dim apiResponse As TextFormatResponse = pdfApi.GetFragmentTextFormat(fileName, pageNumber, fragmentNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim segTextFormat As TextFormat = apiResponse.TextFormat
Console.WriteLine("Segment Font Name - " + segTextFormat.FontName)
Console.WriteLine("Segment Font Size - " + segTextFormat.FontSize.Value)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "segments.pdf"
Dim pageNumber As Integer = 1
Dim fragmentNumber As Integer = 1
Dim segmentNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get text format of particular segment
Dim apiResponse As TextFormatResponse = pdfApi.GetSegmentTextFormat(fileName, pageNumber, fragmentNumber, segmentNumber, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Dim segTextFormat As TextFormat = apiResponse.TextFormat
Console.WriteLine("Segment Font Name - " + segTextFormat.FontName)
Console.WriteLine("Segment Font Size - " + segTextFormat.FontSize.Value)
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim withEmpty As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get text items from pdf document
Dim apiResponse As TextItemsResponse = pdfApi.GetTextItems(fileName, withEmpty, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each textItem As TextItem In apiResponse.TextItems.List
Console.WriteLine("Text:" + textItem.Text)
Next
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim withEmpty As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get text items from pdf page
Dim apiResponse As TextItemsResponse = pdfApi.GetPageTextItems(fileName, pageNumber, withEmpty, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each textItem As TextItem In apiResponse.TextItems.List
Console.WriteLine("Text:" + textItem.Text)
Next
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim fragmentNumber As Integer = 1
Dim withEmpty As [String] = ""
Dim storage As [String] = ""
Dim folder As [String] = ""
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to get text from particular fragment of pdf document
Dim apiResponse As TextItemsResponse = pdfApi.GetFragment(fileName, pageNumber, fragmentNumber, withEmpty, storage, folder)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
For Each textItem As TextItem In apiResponse.TextItems.List
Console.WriteLine("Text:" + textItem.Text)
Next
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New TextReplaceListRequest()
Dim tr1 As New TextReplace()
tr1.OldValue = "Sample"
tr1.NewValue = "Aspose Sample"
Dim tr2 As New TextReplace()
tr2.OldValue = "PDF"
tr2.NewValue = "PDF Document"
body.TextReplaces = New List(Of TextReplace)() From { _
tr1, _
tr2 _
}
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace mutiple text in pdf page
Dim apiResponse As PageTextReplaceResponse = pdfApi.PostPageReplaceTextList(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Multiple Texts in a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New TextReplaceListRequest()
Dim tr1 As New TextReplace()
tr1.OldValue = "Sample"
tr1.NewValue = "Aspose Sample"
Dim tr2 As New TextReplace()
tr2.OldValue = "PDF"
tr2.NewValue = "PDF Document"
body.TextReplaces = New List(Of TextReplace)() From { _
tr1, _
tr2 _
}
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace multiple text in PDF
Dim apiResponse As DocumentTextReplaceResponse = pdfApi.PostDocumentReplaceTextList(fileName, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Multiple Texts in a PDF, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New TextReplace()
body.OldValue = "Sample PDF"
body.NewValue = "Sample Aspose PDF"
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace text in a pdf file
Dim apiResponse As DocumentTextReplaceResponse = pdfApi.PostDocumentReplaceText(fileName, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Text in a PDF File, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New TextReplace()
body.OldValue = "Sample PDF"
body.NewValue = "Sample Aspose PDF"
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to replace text in a pdf page
Dim apiResponse As PageTextReplaceResponse = pdfApi.PostPageReplaceText(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing AndAlso apiResponse.Status.Equals("OK") Then
Console.WriteLine("Replace Text in a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim imageFile As [String] = "aspose-cloud.png"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Stamp()
body.FileName = imageFile
body.Background = True
body.Type = "Image"
body.PageIndex = 0
body.LeftMargin = 0.0
body.Opacity = 0.5
body.RightMargin = 0.0
body.TopMargin = 0.0
body.YIndent = 100.0
body.XIndent = 100.0
body.Zoom = 1.0
body.TextState = Nothing
body.Width = 300.0
body.Height = 300.0
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
storageApi.PutCreate(imageFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile))
' Invoke Aspose.PDF Cloud SDK API to add image stamp to a pdf page
Dim apiResponse As SaaSposeResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing Then
Console.WriteLine("Add Image Stamp (Watermark) to a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Stamp()
body.Background = True
body.Value = "Page # of 2"
body.Type = "PageNumber"
body.PageIndex = 0
body.LeftMargin = 0.0
body.Opacity = 0.5
body.RightMargin = 0.0
body.TopMargin = 0.0
body.YIndent = 100.0
body.XIndent = 100.0
body.Zoom = 1.0
body.TextState = Nothing
body.Width = 300.0
body.Height = 300.0
body.StartingNumber = 1
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to add page number stamp to a pdf page
Dim apiResponse As SaaSposeResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing Then
Console.WriteLine("Add Page Number Stamp to a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pdfName As [String] = "Sample.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Stamp()
body.FileName = pdfName
body.Background = True
body.Type = "Image"
body.PageIndex = 0
body.LeftMargin = 0.0
body.Opacity = 0.5
body.RightMargin = 0.0
body.TopMargin = 0.0
body.YIndent = 100.0
body.XIndent = 100.0
body.Zoom = 1.0
body.TextState = Nothing
body.Width = 300.0
body.Height = 300.0
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
storageApi.PutCreate(pdfName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + pdfName))
' Invoke Aspose.PDF Cloud SDK API to add pdf page as stamp to a pdf page
Dim apiResponse As SaaSposeResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing Then
Console.WriteLine("Add PDF Page as Stamp (Watermark) to a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
' For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Cloud
Dim pdfApi As New PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim storageApi As New StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH)
Dim fileName As [String] = "sample-input.pdf"
Dim pageNumber As Integer = 1
Dim storage As [String] = ""
Dim folder As [String] = ""
Dim body As New Stamp()
body.Value = "Aspose.com"
body.Background = True
body.Type = "Text"
Try
' Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName))
' Invoke Aspose.PDF Cloud SDK API to add text stamp to a pdf page
Dim apiResponse As SaaSposeResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body)
If apiResponse IsNot Nothing Then
Console.WriteLine("Add Text Stamp (Watermark) to a PDF Page, Done!")
Console.ReadKey()
End If
Catch ex As Exception
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + vbLf + ex.StackTrace)
End Try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment