Last active
January 7, 2019 11:38
-
-
Save aspose-cloud/1712a9f92319502bd5347a0e9547c5c2 to your computer and use it in GitHub Desktop.
The GIST contains Examples of Aspose.Words Cloud.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The GIST contains Examples of Aspose.Words Cloud. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
var localName = "Sample.pdf"; | |
var remoteName = "Sample.pdf"; | |
var fullName = Path.Combine(this.dataFolder, remoteName); | |
var format = "doc"; | |
var destFileName = Path.Combine(BaseTestOutPath, Path.GetFileNameWithoutExtension(remoteName) + "." + format); | |
this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName)); | |
var request = new GetDocumentWithFormatRequest(remoteName, format, this.dataFolder, outPath: destFileName); | |
this.WordsApi.GetDocumentWithFormat(request); | |
var result = this.StorageApi.GetIsExist(destFileName, null, null); | |
Assert.IsNotNull(result, "Cannot download document from storage"); | |
Assert.IsTrue(result.FileExist.IsExist, "File doesn't exist on storage"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
var localName = "Sample.pdf"; | |
var remoteName = "Sample.pdf"; | |
var fullName = Path.Combine(this.dataFolder, remoteName); | |
var index = 0; | |
this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName)); | |
var request = new GetDocumentParagraphRequest(remoteName, index, this.dataFolder, nodePath: "sections/0"); | |
var actual = this.WordsApi.GetDocumentParagraph(request); | |
Assert.AreEqual(200, actual.Code); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get bookmarks from document | |
BookmarksResponse apiResponse = wordsApi.GetDocumentBookmarks(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (Com.Aspose.Words.Model.Bookmark bookmark in apiResponse.Bookmarks.BookmarkList) | |
{ | |
Console.WriteLine("Name: " + bookmark.Name + " Text: " + bookmark.Text + " link: " + bookmark.link.Href); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get bookmarks from document by name | |
BookmarkResponse apiResponse = wordsApi.GetDocumentBookmarkByName(fileName, "test", storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Name: " + apiResponse.Bookmark.Name + " Text: " + apiResponse.Bookmark.Text + " link: " + apiResponse.Bookmark.link.Href); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get bookmarks from document by name | |
BookmarkResponse apiResponse = wordsApi.PostUpdateDocumentBookmark(fileName, "test", "", storage, folder, null); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Bookmark updated."); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String docFileName = "SampleWordDocument.docx"; | |
String fileName = docFileName; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to accept all tracking changes in document | |
RevisionsModificationResponse apiResponse = wordsApi.AcceptAllRevisions(docFileName, null, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document track changes have been accepted successfully "); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set destination file name | |
String destFileName = "test_doc.docx"; | |
// Set source file name | |
String sourceFileName = "test_uploadfile.docx"; | |
Com.Aspose.Words.Model.DocumentEntryList body = new Com.Aspose.Words.Model.DocumentEntryList(); | |
List<Com.Aspose.Words.Model.DocumentEntry> docEntries = new List<Com.Aspose.Words.Model.DocumentEntry>(); | |
Com.Aspose.Words.Model.DocumentEntry docEntry = new Com.Aspose.Words.Model.DocumentEntry(); | |
docEntry.Href = sourceFileName; | |
docEntry.ImportFormatMode = "KeepSourceFormatting"; | |
docEntries.Add(docEntry); | |
body.DocumentEntries = docEntries; | |
try | |
{ | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(sourceFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + destFileName)); | |
// Upload destination file to aspose cloud storage | |
storageApi.PutCreate(destFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + sourceFileName)); | |
// Invoke Aspose.Words Cloud SDK API to append word document | |
Com.Aspose.Words.Model.DocumentResponse apiResponse = wordsApi.PostAppendDocument(destFileName, null, null, null, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Documents have been appended successfully"); | |
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(destFileName, null, null); | |
System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream); | |
System.IO.File.WriteAllBytes(Common.GetDataDir() + sourceFileName, storageRes.ResponseStream); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "Rendering.docx"; | |
String storage = null; | |
String folder = null; | |
Com.Aspose.Words.Model.SaveOptionsData body = new Com.Aspose.Words.Model.SaveOptionsData(); | |
body.SaveFormat = "pdf"; | |
body.FileName = "output.pdf"; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to convert words document to required format | |
SaveResponse apiResponse = wordsApi.PostDocumentSaveAs(fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("doc:" + apiResponse.SaveResult.DestDocument.Href); | |
//Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "test_uploadfile.docx"; | |
String format = "pdf"; | |
String storage = ""; | |
String folder = ""; | |
String outPath = ""; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to convert document to images | |
ResponseMessage apiResponse = wordsApi.GetDocumentWithFormat(fileName, format, storage, folder, outPath); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
System.Diagnostics.Debug.WriteLine("response:" + apiResponse.ResponseStream); | |
System.IO.File.WriteAllBytes( Common.GetDataDir() + "WordFormatConverterExampleTest.pdf", apiResponse.ResponseStream); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "test_uploadfile.docx"; | |
String format = "pdf"; | |
String storage = "dropboxstorage"; | |
String folder = ""; | |
String outPath = ""; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to convert words document to images using third party storage | |
ResponseMessage apiResponse = wordsApi.GetDocumentWithFormat(fileName, format, storage, folder, outPath); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
System.Diagnostics.Debug.WriteLine("response:" + apiResponse.ResponseStream); | |
System.IO.File.WriteAllBytes( Common.GetDataDir() + "WordFormatConverterExampleTest.pdf", apiResponse.ResponseStream); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string format = "pdf"; | |
string outPath = null; | |
string replaceResourcesHostTo = "new_pdf.pdf"; | |
byte[] file = System.IO.File.ReadAllBytes( Common.GetDataDir() + "test_uploadfile.docx"); | |
try | |
{ | |
// Invoke Aspose.Words Cloud SDK API | |
ResponseMessage apiResponse = wordsApi.PutConvertDocument(format, outPath, replaceResourcesHostTo, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
System.Diagnostics.Debug.WriteLine("response:" + apiResponse.ResponseStream); | |
System.IO.File.WriteAllBytes("\\temp\\" + replaceResourcesHostTo, apiResponse.ResponseStream); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
LoadWebDocumentData body = new LoadWebDocumentData(); | |
var soptions = new SaveOptionsData(); | |
soptions.FileName = "google.doc"; | |
soptions.SaveFormat = "doc"; | |
soptions.ColorMode = "1"; | |
soptions.DmlEffectsRenderingMode = "1"; | |
soptions.DmlRenderingMode = "1"; | |
soptions.UpdateSdtContent = false; | |
soptions.ZipOutput = false; | |
body.LoadingDocumentUrl = "http://google.com"; | |
body.SaveOptions = soptions; | |
try | |
{ | |
// Invoke Aspose.Words Cloud SDK API to convert web pages to word documents | |
SaveResponse apiResponse = wordsApi.PostLoadWebDocument(body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document " + apiResponse.SaveResult.DestDocument.Href + " has been generated successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string name = "test_multi_pages.docx"; | |
int commentIndex = 1; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name)); | |
// Invoke Aspose.Words Cloud SDK API to get comments | |
Com.Aspose.Words.Model.CommentResponse apiResponse; | |
apiResponse = wordsApi.GetComment(name, commentIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine( apiResponse.Comment.Text); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get word and paragraph count from word document | |
StatDataResponse apiResponse = wordsApi.GetDocumentStatistics(fileName, false, false, false, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Total Words: " + apiResponse.StatData.WordCount); | |
Console.WriteLine("Total Paragraphs: " + apiResponse.StatData.ParagraphCount); | |
Console.WriteLine("Total Page Count: " + apiResponse.StatData.PageCount); | |
foreach (PageStatData pageStat in apiResponse.StatData.PageStatData) | |
{ | |
Console.WriteLine("Page# " + pageStat.PageNumber); | |
Console.WriteLine("Page Word Count: " + pageStat.WordCount); | |
Console.WriteLine("Page Paragraph Count: " + pageStat.ParagraphCount); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get all document properties | |
DocumentPropertiesResponse apiResponse = wordsApi.GetDocumentProperties(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Doc Properties"); | |
foreach (DocumentProperty docProperty in apiResponse.DocumentProperties.List) | |
{ | |
Console.WriteLine(docProperty.Name + " : " + docProperty.Value); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String propertyName = "Author"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get particular document property | |
DocumentPropertyResponse apiResponse = wordsApi.GetDocumentProperty(fileName, propertyName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
DocumentProperty docProperty = apiResponse.DocumentProperty; | |
Console.WriteLine(docProperty.Name + " : " + docProperty.Value); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String propertyName = "Author"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get particular document property | |
DocumentPropertyResponse apiResponse = wordsApi.GetDocumentProperty(fileName, propertyName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
DocumentProperty docProperty = apiResponse.DocumentProperty; | |
Console.WriteLine(docProperty.Name + " : " + docProperty.Value); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String propertyName = "AsposeAuthor"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to remove particular document property | |
SaaSposeResponse apiResponse = wordsApi.DeleteDocumentProperty(fileName, propertyName, fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("The document property has been removed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String propertyName = "Author"; | |
String storage = null; | |
String folder = null; | |
DocumentProperty body = new DocumentProperty(); | |
body.Name = "Author"; | |
body.Value = "Naeem Akram"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to set single property | |
DocumentPropertyResponse apiResponse = wordsApi.PutUpdateDocumentProperty(fileName, propertyName, fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
DocumentProperty docProperty = apiResponse.DocumentProperty; | |
Console.WriteLine(docProperty.Name + " : " + docProperty.Value); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String docFileName = "SampleWordDocument.docx"; | |
String fileName = docFileName; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to reject all tracking changes from document | |
RevisionsModificationResponse apiResponse = wordsApi.RejectAllRevisions(docFileName, null, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document track changes have been rejected successfully "); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "SampleWordDocument.docx"; | |
String format = "pdf"; | |
int? from = null; | |
int? to = null; | |
Boolean zipOutput = true; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to split all pages to new PDFs | |
SplitDocumentResponse apiResponse = wordsApi.PostSplitDocument(fileName, format, from, to, zipOutput, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (Link pageLink in apiResponse.SplitResult.Pages) | |
{ | |
String outputFileName = pageLink.Href; | |
Console.WriteLine("file:" + outputFileName); | |
} | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "SampleWordDocument.docx"; | |
String format = "png"; | |
int? from = 1; | |
int? to = 2; | |
Boolean zipOutput = true; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to split specific pages to any format | |
SplitDocumentResponse apiResponse = wordsApi.PostSplitDocument(fileName, format, from, to, zipOutput, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (Link pageLink in apiResponse.SplitResult.Pages) | |
{ | |
String outputFileName = pageLink.Href; | |
Console.WriteLine("file:" + outputFileName); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "SampleWordDocument.docx"; | |
String format = "pdf"; | |
int? from = 1; | |
int? to = 2; | |
Boolean zipOutput = true; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to split specific pages to new pdfs | |
SplitDocumentResponse apiResponse = wordsApi.PostSplitDocument(fileName, format, from, to, zipOutput, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (Link pageLink in apiResponse.SplitResult.Pages) | |
{ | |
String outputFileName = pageLink.Href; | |
Console.WriteLine("file:" + outputFileName); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
// Set input file name | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir()+ fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get all drawing object from document | |
DrawingObjectsResponse apiResponse = wordsApi.GetDocumentDrawingObjects(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Got the Drawing Objects successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "sample_EmbeddedOLE.docx"; | |
int objectIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get OLE data from image object | |
ResponseMessage apiResponse = wordsApi.GetDocumentDrawingObjectOleData(fileName, objectIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Got the OLE Drawing Object from Document successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int objectIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to read image data | |
ResponseMessage apiResponse = wordsApi.GetDocumentDrawingObjectByIndex(fileName, objectIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Got the Drawing Objects successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "GetField.docx"; | |
int sectionIndex = 0; | |
int paragraphIndex = 0; | |
int fieldIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to delete form field | |
SaaSposeResponse apiResponse = wordsApi.DeleteField(fileName, sectionIndex, paragraphIndex, fieldIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Delete a specific field from a Section or Paragraph in a Word Document, Done!"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "GetField.docx"; | |
int sectionIndex = 0; | |
int paragraphIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get all fields from document | |
ResponseMessage apiResponse = wordsApi.GetFields(fileName, sectionIndex, paragraphIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("Ok")) | |
{ | |
Console.WriteLine("Get all fields from document, Done!"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleMailMergeTemplate.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get merge field names from document | |
FieldNamesResponse apiResponse = wordsApi.GetDocumentFieldNames(fileName, false, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (String fieldName in apiResponse.FieldNames.Names) | |
{ | |
Console.WriteLine(fieldName); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
PageNumber body = new PageNumber(); | |
body.Format = "{PAGE} of {NUMPAGES}"; | |
body.Alignment = "center"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to insert page number into document | |
DocumentResponse apiResponse = wordsApi.PostInsertPageNumbers(fileName, fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Page Number Field has been inserted successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = "dropboxstorage"; | |
String folder = null; | |
PageNumber body = new PageNumber(); | |
body.Format = "{PAGE} of {NUMPAGES}"; | |
body.Alignment = "center"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to insert page number using third party storage | |
DocumentResponse apiResponse = wordsApi.PostInsertPageNumbers(fileName, fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Page Number Field has been inserted successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "test_multi_pages.docx"; | |
int sectionIndex = 0; | |
int paragraphIndex = 0; | |
string insertBeforeNode = null; | |
string destFileName = "test.docx"; | |
string storage = null; | |
string folder = null; | |
FormField body = new FormField(); | |
Link lnk = new Link(); | |
lnk.Href = ""; | |
body.Name = "FullName"; | |
body.Enabled = true; | |
body.CalculateOnExit = true; | |
body.StatusText = ""; | |
body.link = lnk; | |
body.TextInputType = "Regular"; | |
body.TextInputDefault = ""; | |
body.TextInputFormat = "UPPERCASE"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to add form fileds | |
FormFieldResponse apiResponse = wordsApi.PutFormField(fileName, sectionIndex, paragraphIndex, insertBeforeNode, destFileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Form field has been added successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to update all fields in document | |
DocumentResponse apiResponse = wordsApi.PostUpdateDocumentFields(fileName, fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document fields have been updated successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int hyperlinkIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get particular hyperlink | |
HyperlinkResponse apiResponse = wordsApi.GetDocumentHyperlinkByIndex(fileName, hyperlinkIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Com.Aspose.Words.Model.Hyperlink hyperlink = apiResponse.Hyperlink; | |
Console.WriteLine("Display Text: " + hyperlink.DisplayText + " Value: " + hyperlink.Value + " link: " + hyperlink.link.Href); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to read all hyperlinks from document | |
HyperlinksResponse apiResponse = wordsApi.GetDocumentHyperlinks(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (Com.Aspose.Words.Model.Hyperlink hyperlink in apiResponse.Hyperlinks.HyperlinkList) | |
{ | |
Console.WriteLine("Text: " + hyperlink.DisplayText + " Value: " + hyperlink.link + " link: " + hyperlink.link.Href); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "TestExecuteResult.doc"; | |
string storage = null; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = false; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "TestExecuteTemplateData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge temlate | |
DocumentResponse apiResponse = wordsApi.PostExecuteTemplate(fileName, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, withRegions, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(destFileName, null, null); | |
System.Diagnostics.Debug.WriteLine("response:" + storageRes.ResponseStream); | |
System.IO.File.WriteAllBytes(Common.GetDataDir() + destFileName, storageRes.ResponseStream); | |
Console.WriteLine("Mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "TestExecuteResult.doc"; | |
string storage = "dropboxstorage"; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = false; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "TestExecuteTemplateData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template using third party storage | |
DocumentResponse apiResponse = wordsApi.PostExecuteTemplate(fileName, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, withRegions, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "updated-" + fileName; | |
string mailMergeDataFile = null; | |
string storage = null; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = false; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "SampleMailMergeTemplateData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template without regions | |
DocumentResponse apiResponse = wordsApi.PostDocumentExecuteMailMerge(fileName, withRegions, mailMergeDataFile, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "updated-" + fileName; | |
string mailMergeDataFile = null; | |
string storage = "dropboxstorage"; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = false; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "SampleMailMergeTemplateData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template without regions using third party storage | |
DocumentResponse apiResponse = wordsApi.PostDocumentExecuteMailMerge(fileName, withRegions, mailMergeDataFile, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "updated-" + fileName; | |
string mailMergeDataFile = null; | |
string storage = null; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = true; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "SampleMailMergeTemplateData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template with regions | |
DocumentResponse apiResponse = wordsApi.PostDocumentExecuteMailMerge(fileName, withRegions, mailMergeDataFile, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "updated-" + fileName; | |
string mailMergeDataFile = null; | |
string storage = "dropboxstorage"; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = true; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "SampleMailMergeTemplateData.txt"); | |
try | |
{ | |
//Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template with regions using third party tool | |
DocumentResponse apiResponse = wordsApi.PostDocumentExecuteMailMerge(fileName, withRegions, mailMergeDataFile, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "TestExecuteTemplate.doc"; | |
string cleanup = null; | |
string destFileName = "updated-" + fileName; | |
string mailMergeDataFile = null; | |
string storage = null; | |
string folder = null; | |
bool useWholeParagraphAsRegion = false; | |
bool withRegions = true; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "SampleMailMergeTemplateImageData.txt"); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir()+ fileName)); | |
storageApi.PutCreate("aspose-cloud.png", "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + "aspose-cloud.png")); | |
// Invoke Aspose.Words Cloud SDK API to insert dynamic images on the merge fields | |
DocumentResponse apiResponse = wordsApi.PostDocumentExecuteMailMerge(fileName, withRegions, mailMergeDataFile, cleanup, destFileName, storage, folder, useWholeParagraphAsRegion, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleMailMergeTemplate.docx"; | |
String fileDataName = "SampleMailMergeTemplateData.txt"; | |
String cleanup = null; | |
Boolean withRegions = false; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName); | |
byte[] data = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileDataName); | |
try | |
{ | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge without regions and without using the cloud storage | |
ResponseMessage apiResponse = wordsApi.PutExecuteMailMergeOnline(withRegions, cleanup, file, data); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("mail merge online template has been executed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleBlankWordDocument.docx"; | |
int sectionIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to extract page setup informations | |
SectionPageSetupResponse apiResponse = wordsApi.GetSectionPageSetup(fileName, sectionIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
PageSetup secPageSetup = apiResponse.PageSetup; | |
Console.WriteLine("getPaperSize :" + secPageSetup.PaperSize + " Orientation: " + secPageSetup.Orientation); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int pageNumber = 1; | |
String format = "bmp"; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to render page to specified format | |
ResponseMessage apiResponse = wordsApi.GetRenderPage(fileName, pageNumber, format, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("Ok")) | |
{ | |
Console.WriteLine("Render page to specified format, Done!"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleBlankWordDocument.docx"; | |
string destFileName = "updated-" + fileName; | |
int sectionIndex = 0; | |
string storage = null; | |
string folder = null; | |
PageSetup body = new PageSetup(); | |
body.RtlGutter = true; | |
body.Orientation = "Portrait"; | |
body.PaperSize = "A5"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to update page setup | |
SectionPageSetupResponse apiResponse = wordsApi.UpdateSectionPageSetup(fileName, sectionIndex, storage, folder, destFileName, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
PageSetup secPageSetup = apiResponse.PageSetup; | |
Console.WriteLine("getPaperSize :" + secPageSetup.PaperSize + " Orientation: " + secPageSetup.Orientation); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
int index = 0; | |
int runIndex = 0; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get font informations of a run from word document | |
FontResponse apiResponse = wordsApi.GetDocumentParagraphRunFont(fileName, index, runIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Font runFont = apiResponse.Font; | |
Console.WriteLine("Font Name : " + runFont.Name); | |
Console.WriteLine("Style : " + runFont.StyleName); | |
Console.WriteLine("Size : " + runFont.Size); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get list of paragraphs from word document | |
ParagraphLinkCollectionResponse apiResponse = wordsApi.GetDocumentParagraphs(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
ParagraphLink docProperty = apiResponse.Paragraphs.ParagraphLinkList[0]; | |
// Display document paragraphs info | |
foreach (ParagraphLink docParagraphLink in apiResponse.Paragraphs.ParagraphLinkList) | |
{ | |
Console.WriteLine("Link : " + docParagraphLink.link); | |
Console.WriteLine("Text : " + docParagraphLink.Text); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int index = 1; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get paragraph from word document | |
ParagraphResponse apiResponse = wordsApi.GetDocumentParagraph(fileName, index, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Com.Aspose.Words.Model.Paragraph docParagraph = apiResponse.Paragraph; | |
Console.WriteLine("NoteId : " + docParagraph.NodeId); | |
Console.WriteLine("Link : " + docParagraph.link.Href); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int index = 1; | |
int runIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get specific run of paragraph | |
RunResponse apiResponse = wordsApi.GetDocumentParagraphRun(fileName, index, runIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Run docParagraphRun = apiResponse.Run; | |
Console.WriteLine("NoteId : " + docParagraphRun.NodeId); | |
Console.WriteLine("Link : " + docParagraphRun.link.Href); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "GetField.docx"; | |
int sectionIndex = 0; | |
int paragraphIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to read all Runs from a Paragraph in a Word Document | |
ResponseMessage apiResponse = wordsApi.GetParagraphRuns(fileName, sectionIndex, paragraphIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("Ok")) | |
{ | |
Console.WriteLine("Read all Runs from a Paragraph in a Word Document, Done!"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
string destFileName = "updated-" + fileName; | |
int index = 0; | |
int runIndex = 0; | |
string storage = null; | |
string folder = null; | |
Font body = new Font(); | |
body.Bold = true; | |
body.Size = 31.0; | |
body.Name = "Calibri"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to update font of run | |
FontResponse apiResponse = wordsApi.PostDocumentParagraphRunFont(fileName, index, runIndex, storage, folder, destFileName, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("paragraph run font has been updated successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleProtectedBlankWordDocument.docx"; | |
String destFileName = fileName; | |
String storage = null; | |
String folder = null; | |
ProtectionRequest body = new ProtectionRequest(); | |
body.Password = "aspose"; | |
body.NewPassword = ""; | |
body.ProtectionType = "NoProtection"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to modify the document protection | |
ProtectionDataResponse apiResponse = wordsApi.PostChangeDocumentProtection(fileName, destFileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document protection property has been changed from protected to unprotected successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleProtectedBlankWordDocument.docx"; | |
String destFileName = fileName; | |
String storage = null; | |
String folder = null; | |
ProtectionRequest body = new ProtectionRequest(); | |
body.Password = "aspose"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to remove the protection | |
ProtectionDataResponse apiResponse = wordsApi.DeleteUnprotectDocument(fileName, destFileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Document has been unprotected successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get all sections | |
SectionLinkCollectionResponse apiResponse = wordsApi.GetSections(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (SectionLink sectionLink in apiResponse.Sections.SectionLinkList) | |
{ | |
Console.WriteLine(sectionLink.link.Href); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleWordDocument.docx"; | |
int sectionIndex = 0; | |
string storage = null; | |
string folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get specific section | |
SectionResponse apiResponse = wordsApi.GetSection(fileName, sectionIndex, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine(apiResponse.Section.link.Href); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to get text items | |
TextItemsResponse apiResponse = wordsApi.GetDocumentTextItems(fileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
foreach (TextItem textItem in apiResponse.TextItems.List) | |
{ | |
Console.WriteLine(textItem.Text); | |
} | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = null; | |
String folder = null; | |
ReplaceTextRequest body = new ReplaceTextRequest(); | |
body.OldValue = "aspose"; | |
body.NewValue = "aspose.com"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to replace text | |
Com.Aspose.Words.Model.ReplaceTextResponse apiResponse = wordsApi.PostReplaceText(fileName, fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Text replaced successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleWordDocument.docx"; | |
String storage = "dropboxstorage"; | |
String folder = null; | |
ReplaceTextRequest body = new ReplaceTextRequest(); | |
body.OldValue = "aspose"; | |
body.NewValue = "aspose.com"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to replace text in a document using third party storage | |
Com.Aspose.Words.Model.ReplaceTextResponse apiResponse = wordsApi.PostReplaceText(fileName, fileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Text replaced successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
string fileName = "SampleBlankWordDocument.docx"; | |
string destFileName = "updated-" + fileName; | |
double rotationAngle = 45.0; | |
string storage = "dropboxstorage"; | |
string folder = null; | |
string image = "aspose-cloud.png"; | |
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName); | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to add watermark image to document | |
DocumentResponse apiResponse = wordsApi.PostInsertWatermarkImage(fileName, destFileName, rotationAngle, image, storage, folder, file); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Watermark image has been added successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleBlankWordDocument.docx"; | |
String destFileName = "updated-" + fileName; | |
Double rotationAngle = 0.0; | |
String storage = "dropboxstorage"; | |
String folder = null; | |
String text = "New"; | |
WatermarkText body = new WatermarkText(); | |
body.Text = "aspose.com"; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to add watermark text to document | |
DocumentResponse apiResponse = wordsApi.PostInsertWatermarkText(fileName, text, rotationAngle, destFileName, storage, folder, body); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Watermark text has been added successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet | |
WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); | |
String fileName = "SampleBlankWatermarkDocument.docx"; | |
String destFileName = "updated-" + fileName; | |
String storage = null; | |
String folder = null; | |
try | |
{ | |
// Upload the file | |
storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); | |
// Invoke Aspose.Words Cloud SDK API to remove watermark from document | |
DocumentResponse apiResponse = wordsApi.DeleteDocumentWatermark(fileName, destFileName, storage, folder); | |
if (apiResponse != null && apiResponse.Status.Equals("OK")) | |
{ | |
Console.WriteLine("Watermark is removed successfully"); | |
Console.ReadKey(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get all the bookmarks from a word document | |
wordsApi.GetDocumentBookmarks(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display the bookmarks info | |
responseMessage.body.Bookmarks.BookmarkList.forEach(function(bookmark) { | |
console.log( "Name: " + bookmark.Name + " Text: " + bookmark.Text + " link: " + bookmark.link.Href); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = 'SampleWordDocument.docx'; | |
var bookmarkName = 'aspose'; | |
try { | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK', ''); | |
wordsApi.GetDocumentBookmarkByName(name, bookmarkName, null, null, function(responseMessage) { | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
assert.equal(responseMessage.status, 'OK', ''); | |
assert.ok(responseMessage.body !== null && typeof responseMessage.body.Bookmark !== 'undefined', "response body assertion should pass"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = 'SampleWordDocument.docx'; | |
var bookmarkData = { | |
'Name' : 'aspose', | |
'Text' : 'Bookmark is very good.' | |
}; | |
try { | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK', ''); | |
wordsApi.PostUpdateDocumentBookmark(name, 'aspose', null, null, null, bookmarkData, function(responseMessage) { | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
assert.equal(responseMessage.status, 'OK', ''); | |
assert.ok(responseMessage.body !== null && typeof responseMessage.body.Bookmark !== 'undefined', "response body assertion should pass"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to accept all revisions | |
wordsApi.AcceptAllRevisions(name, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document track changes have been accepted successfully"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = 'SampleWordDocument.docx'; | |
var document1 = 'FormFilled.docx'; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Upload appended file to aspose cloud storage | |
storageApi.PutCreate(document1, null, null, file= data_path + document1 , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var documentEntryList = {'DocumentEntries' : [ | |
{ | |
'Href' : document1, | |
'ImportFormatMode' : 'KeepSourceFormatting' | |
} | |
]}; | |
// Invoke Aspose.Words Cloud SDK API to append word document | |
wordsApi.PostAppendDocument(name, null, null, null, documentEntryList, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Documents have been appended successfully"); | |
// Download appended document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'appended-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var filename = "SampleWordDocument"; | |
var name = filename + ".docx"; | |
var format = "html"; | |
var outfilename = "SampleWordDocumentOutput.html"; | |
var body = {'FileName' : outfilename, | |
'SaveFormat' : 'html', | |
'PrettyFormat' : 'true' | |
}; | |
try { | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(name, null, null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to save document to required format | |
wordsApi.PostDocumentSaveAs(name, null, null, body, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download document from storage server | |
storageApi.GetDownload(outfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var filename = "SampleWordDocument"; | |
var name = filename + ".docx"; | |
var format = "pdf"; | |
try { | |
// Upload file to aspose cloud storage | |
storageApi.PutCreate(name, null, null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to convert words document to required format | |
wordsApi.GetDocumentWithFormat(name, format, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download output document from response | |
var outfilename = filename + '.' + format; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var filename = "SampleWordDocument"; | |
var name = filename + ".docx"; | |
var format = "pdf"; | |
var storage="AsposeDropboxStorage"; | |
try { | |
// Upload file to 3rd Party (like dropbox cloud storage) | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to convert words document to required format | |
wordsApi.GetDocumentWithFormat(name, format, storage, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download output document from response | |
var outfilename = filename + '.' + format; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var filename = "SampleWordDocument"; | |
var name = filename + ".docx"; | |
var format = "pdf"; | |
try { | |
// Invoke Aspose.Words Cloud SDK API to convert words document to required format using file | |
wordsApi.PutConvertDocument(format, null, data_path + name, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download output document from response | |
var outfilename = filename + '.' + format; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var filename ="WebPageConverterExample.doc"; | |
var loadWebDocumentDataBody = { | |
'LoadingDocumentUrl' : 'http://www.aspose.com/corporate/default.aspx', | |
'SaveOptions' : { | |
'SaveFormat' : 'doc', | |
'FileName' : filename | |
} | |
}; | |
try { | |
// Invoke Aspose.Words Cloud SDK API to convert live web page into words document | |
wordsApi.PostLoadWebDocument(loadWebDocumentDataBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been generated successfully"); | |
// Download output document from storage server | |
var outfilename = filename; | |
storageApi.GetDownload(outfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
var name = 'test_multi_pages.docx'; | |
try { | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK', ''); | |
wordsApi.GetComments(name, null, null, function(responseMessage) { | |
console.log('status:', responseMessage.status); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get document statistics | |
wordsApi.GetDocumentStatistics(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Total Words: " + responseMessage.body.StatData.WordCount); | |
console.log("Total Paragraphs: " + responseMessage.body.StatData.ParagraphCount); | |
console.log("Total Page Count: " + responseMessage.body.StatData.PageCount); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get all document properties from a word document | |
wordsApi.GetDocumentProperties(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display document property info | |
responseMessage.body.DocumentProperties.List.forEach(function(docProperty) { | |
console.log(docProperty.Name + " : " + docProperty.Value); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var propertyName = "AsposeAuthor"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get document property by given name from a word document | |
wordsApi.GetDocumentProperty(name, propertyName, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display document property info | |
var docProperty = responseMessage.body.DocumentProperty | |
console.log(docProperty.Name + " : " + docProperty.Value); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var propertyName = "AsposeAuthor"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to delete document property by given name from a word document | |
wordsApi.DeleteDocumentProperty(name, propertyName, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("The document property has been removed successfully" ); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var propertyName = "Author"; | |
var DocumentPropertyBody = { | |
'Name' : 'Author', | |
'Value' : 'Naeem Akram' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to update document property by given name from a word document | |
wordsApi.PutUpdateDocumentProperty(name, propertyName, null, null, null, DocumentPropertyBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display document property info | |
var docProperty = responseMessage.body.DocumentProperty | |
console.log(docProperty.Name + " : " + docProperty.Value); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to reject all revisions | |
wordsApi.RejectAllRevisions(name, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document track changes have been rejected successfully"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var format = "pdf"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to split word document | |
wordsApi.PostSplitDocument(name, format, null, null, true, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been splitted to pfds successfully"); | |
// Download splitted pdfs from storage server as zipOutput | |
var outfilename = responseMessage.body.SplitResult.ZippedPages.Href; | |
storageApi.GetDownload(outfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var format = "png"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to split word document | |
wordsApi.PostSplitDocument(name, format, 2, 3, false, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been splitted to png successfully"); | |
// Download splitted png from storage server | |
var outfilename = responseMessage.body.SplitResult.Pages[0].Href; | |
storageApi.GetDownload(outfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var format = "pdf"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to split word document | |
wordsApi.PostSplitDocument(name, format, 2, 2, false, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been splitted to pdf successfully"); | |
// Download splitted pdf from storage server | |
var outfilename = responseMessage.body.SplitResult.Pages[0].Href; | |
storageApi.GetDownload(outfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var format = "PNG"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get list of all drawing objects present in a word document | |
wordsApi.GetDocumentDrawingObjects(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Export all drawing objects to PNG | |
responseMessage.body.DrawingObjects.List.forEach(function(item) { | |
var objectIndex = item.link.Href.substring(item.link.Href.lastIndexOf('/')+1); | |
wordsApi.GetDocumentDrawingObjectByIndexWithFormat(name, objectIndex, format, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var destfilename = "DrawingObject_out_" + objectIndex + ".png"; | |
var writeStream = fs.createWriteStream(data_path + destfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "sample_EmbeddedOLE.docx"; | |
var objectIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get ole drawing object by index in a word document | |
wordsApi.GetDocumentDrawingObjectOleData(name, objectIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var destfilename = "OLEDrawingObject_out_" + objectIndex + ".pdf"; | |
var writeStream = fs.createWriteStream(data_path + destfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var objectIndex = 1; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get drawing object by index present in a word document | |
wordsApi.GetDocumentDrawingObjectImageData(name, objectIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var destfilename = "DrawingObject_out_" + objectIndex + ".png"; | |
var writeStream = fs.createWriteStream(data_path + destfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWordDocument.docx"; | |
var sectionIndex = 0; | |
var paragraphIndex = 0; | |
var formFieldBody = { | |
'Name' : 'MyName', | |
'Enabled' : 'true', | |
'OwnStatus' : 'false', | |
'CalculateOnExit' : 'true', | |
'TextInputFormat' : 'UPPERCASE', | |
'TextInputType' : 'Regular', | |
'TextInputDefault' : 'Farooq Sheikh' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to add field in the document | |
wordsApi.PutFormField(name, sectionIndex, paragraphIndex, null, null, null, null, formFieldBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'updated-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "GetField.docx"; | |
var sectionIndex = 0; | |
var paragraphIndex = 0; | |
var fieldIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to delete form field | |
wordsApi.DeleteField(name, sectionIndex, paragraphIndex, fieldIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Delete a specific field from a Section or Paragraph in a Word Document, Done!"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "GetField.docx"; | |
var sectionIndex = 0; | |
var paragraphIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get all fields from document | |
wordsApi.GetFields(name, sectionIndex, paragraphIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Get all fields from document, Done!"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleMailMergeTemplate.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get merge field names from a word document | |
wordsApi.GetDocumentFieldNames(name, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Get all merge field names from document | |
responseMessage.body.FieldNames.Names.forEach(function(fieldName) { | |
console.log( fieldName) | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var pageNumberdBody = { | |
'Format' : '{PAGE} of {NUMPAGES}', | |
'Alignment' : 'center' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to insert page number field into a word document | |
wordsApi.PostInsertPageNumbers(name, null, null, null, pageNumberdBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'updated-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var storage = "AsposeDropboxStorage"; | |
var pageNumberdBody = { | |
'Format' : '{PAGE} of {NUMPAGES}', | |
'Alignment' : 'center' | |
}; | |
try { | |
// Upload source file to 3rd party cloud storage | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to insert page number field into a word document | |
wordsApi.PostInsertPageNumbers(name, null, storage, null, pageNumberdBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'updated-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to update fields in the whole document | |
wordsApi.PostUpdateDocumentFields(name, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document fields have been updated successfully"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var hyperlinkIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get a particular hyperlink in a word document | |
wordsApi.GetDocumentHyperlinkByIndex(name, hyperlinkIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var hyperlink = responseMessage.body.Hyperlink; | |
// Display the hyperlinks info | |
console.log("Display Text: " + hyperlink.DisplayText + " Value: " + hyperlink.Value + " link: " + hyperlink.link.Href); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get all the hyperlinks in a word document | |
wordsApi.GetDocumentHyperlinks(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display the hyperlinks info | |
responseMessage.body.Hyperlinks.HyperlinkList.forEach(function(hyperlink) { | |
console.log("Display Text: " + hyperlink.DisplayText + " Value: " + hyperlink.Value + " link: " + hyperlink.link.Href); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleExecuteTemplate.doc"; | |
var filedataname = "SampleExecuteTemplateData.txt"; | |
var destfilename = "updated-" + name | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template and populate a word document from XML data | |
wordsApi.PostExecuteTemplate(name, null, destfilename, null, null, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleExecuteTemplate.doc"; | |
var filedataname = "SampleExecuteTemplateData.txt"; | |
var destfilename = "updated-" + name | |
var storage = "AsposeDropboxStorage"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge template and populate a word document from XML data | |
wordsApi.PostExecuteTemplate(name, null, destfilename, storage, null, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleMailMergeTemplate.docx"; | |
var filedataname = "SampleMailMergeTemplateData.txt"; | |
var destfilename = "updated-" + name; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
wordsApi.PostDocumentExecuteMailMerge(name, false, null, null, destfilename, null, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleMailMergeTemplate.docx"; | |
var filedataname = "SampleMailMergeTemplateData.txt"; | |
var destfilename = "updated-" + name; | |
var storage = "AsposeDropboxStorage"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
wordsApi.PostDocumentExecuteMailMerge(name, false, null, null, destfilename, storage, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleInvoiceTemplate.doc"; | |
var filedataname = "SampleInvoiceTemplateData.txt"; | |
var destfilename = "updated-" + name; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
wordsApi.PostDocumentExecuteMailMerge(name, true, null, null, destfilename, null, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleInvoiceTemplate.doc"; | |
var filedataname = "SampleInvoiceTemplateData.txt"; | |
var destfilename = "updated-" + name; | |
var storage = "AsposeDropboxStorage"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
wordsApi.PostDocumentExecuteMailMerge(name, true, null, null, destfilename, storage, null, null, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleMailMergeTemplateImage.doc"; | |
var filedataname = "SampleMailMergeTemplateImageData.txt"; | |
var destfilename = "updated-" + name; | |
var logofile = "header-logo.png"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
storageApi.PutCreate(logofile, null, null, file= data_path + logofile , function(responseMessage) { | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
wordsApi.PostDocumentExecuteMailMerge(name, false, null, null, destfilename, null, null, false, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
if(config.debug){console.log('status:', responseMessage.status);} | |
if(config.debug){console.log('body:', responseMessage.body);} | |
console.log("mail merge template has been executed successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(destfilename, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleMailMergeTemplate.docx"; | |
var filedataname = "SampleMailMergeTemplateData.txt"; | |
var destfilename = "updated-" + name; | |
try { | |
// Invoke Aspose.Words Cloud SDK API to execute mail merge online and populate a word document from XML data | |
wordsApi.PutExecuteMailMergeOnline(false, null, data_path + name, data_path + filedataname, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("mail merge online template has been executed successfully"); | |
// Download updated document from response | |
var outfilename = destfilename; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var sectionIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get page setup properties by given section index from a word document | |
wordsApi.GetSectionPageSetup(name, sectionIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var secPageSetup = responseMessage.body.PageSetup | |
if(secPageSetup !==null){ | |
console.log( "PaperSize :" + responseMessage.body.PageSetup.PaperSize + " Orientation: " + responseMessage.body.PageSetup.Orientation); | |
} | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var pageNumber = 1; | |
var format = "bmp"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to render page to specified format | |
wordsApi.GetRenderPage(name, pageNumber, format, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Render page to specified format, Done!"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWordDocument.docx"; | |
var sectionIndex = 0; | |
var pageSetupBody = { | |
'RtlGutter' : true, | |
'Orientation' : 'Portrait', | |
'PaperSize' : 'A5' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to update page setup properties by given section index from a word document | |
wordsApi.UpdateSectionPageSetup(name, sectionIndex, null, null, null, pageSetupBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var secPageSetup = responseMessage.body.PageSetup | |
if(secPageSetup !==null){ | |
console.log( "PaperSize :" + responseMessage.body.PageSetup.PaperSize + " Orientation: " + responseMessage.body.PageSetup.Orientation); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'updated-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
} | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var index = 1; | |
var runIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get a font related information of a specific run of a paragraph from a word document | |
wordsApi.GetDocumentParagraphRunFont(name, index, runIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var runFont = responseMessage.body.Font; | |
// Display run font info | |
console.log("Font Name : " + runFont.Name); | |
console.log("Style : " + runFont.StyleName); | |
console.log("Size : " + runFont.Size); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get list of paragraphs from a word document | |
wordsApi.GetDocumentParagraphs(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Display document paragraphs info | |
responseMessage.body.Paragraphs.ParagraphLinkList.forEach(function(docParagraphLink) { | |
console.log("Link Href: " + docParagraphLink.link.Href); | |
console.log("Text : " + docParagraphLink.Text); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var index = 1; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get a specific paragraph from a word document | |
wordsApi.GetDocumentParagraph(name, index, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var docParagraph = responseMessage.body.Paragraph; | |
// Display document paragraph info | |
console.log("NoteId : " + docParagraph.NodeId); | |
console.log("Link : " + docParagraph.link.Href); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var index = 1; | |
var runIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get a specific run of a paragraph from a word document | |
wordsApi.GetDocumentParagraphRun(name, index, runIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var docParagraphRun = responseMessage.body.Run; | |
// Display document paragraph run info | |
console.log( "NoteId : " + docParagraphRun.NodeId); | |
console.log("Text : " + docParagraphRun.Text); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "GetField.docx"; | |
var sectionIndex = 0; | |
var paragraphIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to read all Runs from a Paragraph in a Word Document | |
wordsApi.GetParagraphRuns(name, sectionIndex, paragraphIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Read all Runs from a Paragraph in a Word Document, Done!"); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var index = 1; | |
var runIndex = 0; | |
var fontBody = { | |
'Bold' : true, | |
'Size' : 31.0, | |
'Name' : 'Calibri' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to update font of a specific run of a paragraph present in a word document | |
wordsApi.PostDocumentParagraphRunFont(name, index, runIndex, null, null, null, fontBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("paragraph run font has been updated successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'updated-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleProtectedBlankWordDocument.docx"; | |
var protectionRequestBody = { | |
'Password' : 'aspose', | |
'ProtectionType' : 'NoProtection', | |
'NewPassword' : '' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to unprotect a word document | |
wordsApi.PostChangeDocumentProtection(name, null, null, null, protectionRequestBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document protection property has been changed from protected to unprotected successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'unprotected_out-' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleProtectedBlankWordDocument.docx"; | |
var protectionRequestBody = { | |
'Password' : 'aspose' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to protect a word document | |
wordsApi.DeleteUnprotectDocument(name, null, null, null, protectionRequestBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been unprotected successfully"); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = 'unprotected_out_' + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get list of all sections present from a word document | |
wordsApi.GetSections(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
responseMessage.body.Sections.SectionLinkList.forEach(function(item) { | |
console.log("Section Href :: " + item.link.Href); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var sectionIndex = 0; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get a specific section present from a word document | |
wordsApi.GetSection(name, sectionIndex, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Section Href :: " + responseMessage.body.Section.link.Href); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to get text items from a word document | |
wordsApi.GetDocumentTextItems(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Get all the TextItem's text | |
responseMessage.body.TextItems.List.forEach(function(textItem) { | |
console.log(textItem.Text); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var replaceTextRequestBody = { | |
'OldValue' : 'aspose', | |
'NewValue' : 'aspose.com' | |
}; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to replace text from a given a Word document | |
wordsApi.PostReplaceText(name, null, null, null, replaceTextRequestBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been updated successfully."); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleWordDocument.docx"; | |
var storage = "AsposeDropboxStorage"; | |
var replaceTextRequestBody = { | |
'OldValue' : 'aspose', | |
'NewValue' : 'aspose.com' | |
}; | |
try { | |
// Upload source file to 3rd party cloud storage | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to replace text from a given word document | |
wordsApi.PostReplaceText(name, null, storage, null, replaceTextRequestBody, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Document has been updated successfully."); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWordDocument.docx"; | |
var image = "aspose-cloud.png"; | |
var storage = "AsposeDropboxStorage"; | |
try { | |
// Upload source file to 3rd party cloud storage | |
storageApi.PutCreate(name, null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to remove add watermark image in a word document | |
wordsApi.PostInsertWatermarkImage(name, null, null, null, storage, null, data_path + image, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Watermark image has been added successfully."); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWordDocument.docx"; | |
var watermarkTextBody = { | |
'Text' : 'aspose.com' | |
}; | |
var storage = "AsposeDropboxStorage"; | |
try { | |
// Upload source file to 3rd party cloud storage | |
storageApi.PutCreate(name, versionId=null, storage, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to add watermark text in a word document | |
wordsApi.PostInsertWatermarkText(name, null, null, null, storage, null, watermarkTextBody,function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Watermark text has been added successfully."); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, storage, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = name; | |
var writeStream = fs.createWriteStream('c:/temp/' + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-node | |
var fs = require('fs'); | |
var assert = require('assert'); | |
var StorageApi = require('asposestoragecloud'); | |
var WordsApi = require('asposewordscloud'); | |
var configProps = require('../Config/config.json'); | |
var data_path = '../../../Data/'; | |
var AppSID = configProps.app_sid; | |
var AppKey = configProps.api_key; | |
var config = {'appSid':AppSID,'apiKey':AppKey , 'debug' : true}; | |
// Instantiate Aspose Storage API SDK | |
var storageApi = new StorageApi(config); | |
// Instantiate Aspose Words API SDK | |
var wordsApi = new WordsApi(config); | |
// Set input file name | |
var name = "SampleBlankWatermarkDocument.docx"; | |
try { | |
// Upload source file to aspose cloud storage | |
storageApi.PutCreate(name, versionId=null, storage=null, file= data_path + name , function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
// Invoke Aspose.Words Cloud SDK API to remove watermark image from a word document | |
wordsApi.DeleteDocumentWatermark(name, null, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
console.log("Watermark image has been removed successfully."); | |
// Download updated document from storage server | |
storageApi.GetDownload(name, null, null, function(responseMessage) { | |
assert.equal(responseMessage.status, 'OK'); | |
var outfilename = "updated_out_" + name; | |
var writeStream = fs.createWriteStream(data_path + outfilename); | |
writeStream.write(responseMessage.body); | |
}); | |
}); | |
}); | |
}catch (e) { | |
console.log("exception in example"); | |
console.log(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::Bookmarks; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get all the bookmarks from a word document | |
$response = $wordsApi->GetDocumentBookmarks(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Display the bookmarks info | |
foreach my $bookmark (@{$response->{'Bookmarks'}->{'BookmarkList'}}){ | |
print "\nName : " . $bookmark->{'Name'} . " Text: " . $bookmark->{'Text'}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::Bookmark; | |
use AsposeWordsCloud::Object::BookmarkResponse; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $bookmarkName = 'aspose'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get all the bookmarks from a word document | |
$response = $wordsApi->GetDocumentBookmarkByName(name=> $name, bookmarkName=>$bookmarkName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::Bookmark; | |
use AsposeWordsCloud::Object::BookmarkResponse; | |
use AsposeWordsCloud::Object::BookmarkData; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $bookmarkDataBody = AsposeWordsCloud::Object::BookmarkData->new( 'Name' => 'aspose', 'Text' => 'Bookmark is very good'); | |
$response = $wordsApi->PostUpdateDocumentBookmark(name=> $name, bookmarkName=>'aspose', body=> $bookmarkDataBody); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to accept all revisions | |
$response = $wordsApi->AcceptAllRevisions(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument track changes have been accepted successfully"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::DocumentEntryList; | |
use AsposeWordsCloud::Object::DocumentEntry; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $document1 = 'SampleWordDocument.docx'; | |
my $document2 = 'SampleWordDocument.docx'; | |
my @docEntry1 = AsposeWordsCloud::Object::DocumentEntry->new('Href' => $document1, 'ImportFormatMode' => 'KeepSourceFormatting'); | |
my @docEntry2 = AsposeWordsCloud::Object::DocumentEntry->new('Href' => $document2, 'ImportFormatMode' => 'KeepSourceFormatting'); | |
my $documentEntryList = AsposeWordsCloud::Object::DocumentEntryList->new('DocumentEntries' => [@docEntry1, @docEntry2]); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to append word document | |
$response = $wordsApi->PostAppendDocument(name=> $name, body=> $documentEntryList); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocuments have been appended successfully"; | |
# Download appended document from storage server | |
my $output_file = $out_path. 'appended-'.$name; | |
$response = $storageApi->GetDownload(Path => $name);; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::SaveOptionsData; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $filename = "SampleWordDocument"; | |
my $name = $filename . ".docx"; | |
my $format = "html"; | |
my $outfilename = "SampleWordDocumentOutput.html"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $saveOptionsData = AsposeWordsCloud::Object::SaveOptionsData->new('SaveFormat' => 'html', 'PrettyFormat' => 'True', 'FileName' => $outfilename); | |
# Invoke Aspose.Words Cloud SDK API to convert words document to required format with additional settings | |
$response = $wordsApi->PostDocumentSaveAs(name=> $name, body=>$saveOptionsData); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from storage server | |
$response = $storageApi->GetDownload(Path => $outfilename); | |
my $output_file = $out_path. $outfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::SaveOptionsData; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $filename = "SampleWordDocument"; | |
my $name = $filename . ".docx"; | |
my $format = "html"; | |
my $outfilename = "SampleWordDocumentOutput.html"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $saveOptionsData = AsposeWordsCloud::Object::SaveOptionsData->new('SaveFormat' => 'html', 'PrettyFormat' => 'True', 'FileName' => $outfilename); | |
# Invoke Aspose.Words Cloud SDK API to convert words document to required format with additional settings | |
$response = $wordsApi->PostDocumentSaveAs(name=> $name, body=>$saveOptionsData); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from storage server | |
$response = $storageApi->GetDownload(Path => $outfilename); | |
my $output_file = $out_path. $outfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::DocumentEntryList; | |
use AsposeWordsCloud::Object::DocumentEntry; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $filename = "SampleWordDocument"; | |
my $name = $filename . ".docx"; | |
my $format = "pdf"; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to convert words document to required format | |
$response = $wordsApi->GetDocumentWithFormat(name=> $name, format=>$format, storage=>$storage); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $filename = "SampleWordDocument"; | |
my $name = $filename . ".docx"; | |
my $format = "pdf"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to convert words document to required format | |
$response = $wordsApi->GetDocumentWithFormat(name=> $name, format=>$format); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from response | |
my $output_file = $out_path. $filename . '.' . $format; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::SaveOptionsData; | |
use AsposeWordsCloud::Object::LoadWebDocumentData; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $filename = 'WebPageConverterExample.doc'; | |
my $saveOptionsData = AsposeWordsCloud::Object::SaveOptionsData->new('SaveFormat' => 'doc', 'FileName' => $filename); | |
my $loadWebDocumentData = AsposeWordsCloud::Object::LoadWebDocumentData->new('LoadingDocumentUrl' => 'http://google.com', 'SaveOptions' => $saveOptionsData); | |
# Invoke Aspose.Words Cloud SDK API to convert live web page into words document | |
my $response = $wordsApi->PostLoadWebDocument(body => $loadWebDocumentData); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been generated successfully"; | |
# Download output document from storage server | |
my $output_file = $filename; | |
$response = $storageApi->GetDownload(Path => $output_file); | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::DocumentEntryList; | |
use AsposeWordsCloud::Object::DocumentEntry; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'test_multi_pages.docx'; | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
if($response->{'Status'} eq 'OK'){ | |
$response = $wordsApi->GetComments(name=> $name); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get document statistics | |
$response = $wordsApi->GetDocumentStatistics(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
print("\nTotal Words: " . $response->{'StatData'}->{'WordCount'}); | |
print("\nTotal Paragraphs: " . $response->{'StatData'}->{'ParagraphCount'}); | |
print("\nTotal Page Count: " . $response->{'StatData'}->{'PageCount'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get all document properties from a word document | |
$response = $wordsApi->GetDocumentProperties(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Display document property info | |
foreach my $docProperty (@{$response->{'DocumentProperties'}->{'List'}}){ | |
print "\n $docProperty->{'Name'}" . " : " . $docProperty->{'Value'}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $propertyName = 'Author'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get document property by given name from a word document | |
$response = $wordsApi->GetDocumentProperty(name=> $name, propertyName=>$propertyName); | |
if($response->{'Status'} eq 'OK'){ | |
my $docProperty = $response->{'DocumentProperty'}; | |
# Display document property info | |
print "\n $docProperty->{'Name'}" . " : " . $docProperty->{'Value'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $propertyName = 'AsposeAuthor'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to delete document property by given name from a word document | |
$response = $wordsApi->DeleteDocumentProperty(name=> $name, propertyName=>$propertyName); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nThe document property has been removed successfully"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::DocumentProperty; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $propertyName = 'Author'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $propertyBody = AsposeWordsCloud::Object::DocumentProperty->new( 'Name' => 'Author', 'Value' => 'Naeem Akram'); | |
# Invoke Aspose.Words Cloud SDK API to update document property by given name from a word document | |
$response = $wordsApi->PutUpdateDocumentProperty(name=> $name, propertyName=>$propertyName, body=>$propertyBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $docProperty = $response->{'DocumentProperty'}; | |
# Display document property info | |
print "\n $docProperty->{'Name'}" . " : " . $docProperty->{'Value'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to reject all revisions | |
$response = $wordsApi->RejectAllRevisions(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument track changes have been rejected successfully"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $format = 'pdf'; | |
my $from = 1; | |
my $to = 2; | |
my $zipOutput = 'True'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to split word document | |
$response = $wordsApi->PostSplitDocument(name=> $name, format=>$format, from=>$from, to=>$to, zipOutput=>$zipOutput); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been splitted to pfds successfully"; | |
# Download splitted pdfs from storage server as zipOutput | |
my $output_file = $response->{'SplitResult'}->{'ZippedPages'}->{'Href'}; | |
$response = $storageApi->GetDownload(Path => $output_file); | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $format = 'png'; | |
my $from = 1; | |
my $to = 2; | |
my $zipOutput = 'False'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to split word document | |
$response = $wordsApi->PostSplitDocument(name=> $name, format=>$format, from=>$from, to=>$to, zipOutput=>$zipOutput); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been splitted to png successfully"; | |
# Download splitted png from storage server | |
my $output_file = @{$response->{'SplitResult'}->{'Pages'}}[0]->{'Href'}; | |
$response = $storageApi->GetDownload(Path => $output_file); | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $format = 'pdf'; | |
my $from = 2; | |
my $to = 2; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to split word document | |
$response = $wordsApi->PostSplitDocument(name=> $name, format=>$format, from=>$from, to=>$to); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been splitted to pdf successfully"; | |
# Download splitted pdf from storage server | |
my $output_file = @{$response->{'SplitResult'}->{'Pages'}}[0]->{'Href'}; | |
$response = $storageApi->GetDownload(Path => $output_file); | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get list of all drawing objects present in a word document | |
$response = $wordsApi->GetDocumentDrawingObjects(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
my $items = (@{$response->{'DrawingObjects'}->{'List'}}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = "SampleOlePdfData.docx"; | |
my $objectIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get ole drawing object by index in a word document | |
$response = $wordsApi->GetDocumentDrawingObjectOleData(name=> $name, objectIndex=>$objectIndex); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from response | |
my $destfilename = $out_path . "OLEDrawingObject_" . $objectIndex . ".pdf"; | |
write_file($destfilename, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = "SampleWordDocument.docx"; | |
my $objectIndex = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get drawing object by index present in a word document | |
$response = $wordsApi->GetDocumentDrawingObjectImageData(name=> $name, objectIndex=>$objectIndex); | |
if($response->{'Status'} eq 'OK'){ | |
# Download output document from response | |
my $destfilename = $out_path. "DrawingObject_" . $objectIndex . ".png"; | |
write_file($destfilename, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::BookmarkData; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleBlankWordDocument.docx'; | |
my $sectionIndex = 0; | |
my $paragraphIndex = 0; | |
my $insertBeforeNode = ""; | |
my $xmlBody = '<FormFieldTextInput>' | |
. '<Name>MyName</Name>' | |
. '<Enabled>true</Enabled>' | |
. '<StatusText />' | |
. '<OwnStatus>false</OwnStatus>' | |
. '<HelpText />' | |
. '<OwnHelp>false</OwnHelp>' | |
. '<CalculateOnExit>true</CalculateOnExit>' | |
. '<EntryMacro />' | |
. '<ExitMacro />' | |
. '<TextInputFormat>UPPERCASE</TextInputFormat>' | |
. '<TextInputType>Regular</TextInputType>' | |
. '<TextInputDefault>Farooq Sheikh</TextInputDefault>' | |
. '</FormFieldTextInput>'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $bookmarkDataBody = AsposeWordsCloud::Object::BookmarkData->new( 'Name' => 'aspose', 'Text' => 'Bookmark is very good'); | |
# Invoke Aspose.Words Cloud SDK API to add field in the document | |
$response = $wordsApi->PutFormField(name=> $name, sectionIndex=>$sectionIndex, | |
paragraphIndex=>$paragraphIndex, insertBeforeNode=>$insertBeforeNode, body=>$xmlBody); | |
if($response->{'Status'} eq 'OK'){ | |
my $bookmark = $response->{'Bookmark'}; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $name); | |
my $output_file = 'updated-' . $name; | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = "GetField.docx"; | |
my $sectionIndex = 0; | |
my $paragraphIndex = 0; | |
my $fieldIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to delete form field | |
$response = $wordsApi->DeleteField(name=> $name, sectionIndex =>$sectionIndex, paragraphIndex =>$paragraphIndex, fieldIndex =>$fieldIndex); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDelete a specific field from a Section or Paragraph in a Word Document, Done!"; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = "GetField.docx"; | |
my $sectionIndex = 0; | |
my $paragraphIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get all fields from document | |
$response = $wordsApi->GetFields(name=> $name, sectionIndex =>$sectionIndex, paragraphIndex =>$paragraphIndex); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nGet all fields from document, Done!"; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleMailMergeTemplate.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get merge field names from a word document | |
$response = $wordsApi->GetDocumentFieldNames(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Get all merge field names from document | |
foreach my $fieldName (@{$response->{'FieldNames'}->{'Names'}}){ | |
print "\nFieldName : " . $fieldName; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::PageNumber; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $pageNumberBody = AsposeWordsCloud::Object::PageNumber->new('Format' => '{PAGE} of {NUMPAGES}', 'Alignment' => 'center'); | |
# Invoke Aspose.Words Cloud SDK API to insert page number field into a word document | |
$response = $wordsApi->PostInsertPageNumbers(name=> $name, body=>$pageNumberBody); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $name); | |
my $output_file = 'updated-' . $name; | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::PageNumber; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage , file => $data_path.$name); | |
my $pageNumberBody = AsposeWordsCloud::Object::PageNumber->new('Format' => '{PAGE} of {NUMPAGES}', 'Alignment' => 'center'); | |
# Invoke Aspose.Words Cloud SDK API to insert page number field into a word document | |
$response = $wordsApi->PostInsertPageNumbers(name=> $name, body=>$pageNumberBody, storage=>$storage); | |
if($response->{'Status'} eq 'OK'){ | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $name, storage=>$storage); | |
my $output_file = 'updated-' . $name; | |
write_file($out_path.$output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleBlankWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to update fields in the whole document | |
$response = $wordsApi->PostUpdateDocumentFields(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
print ("\nDocument fields have been updated successfully"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $hyperlinkIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get a particular hyperlink in a word document | |
$response = $wordsApi->GetDocumentHyperlinkByIndex(name=> $name, hyperlinkIndex=>$hyperlinkIndex); | |
if($response->{'Status'} eq 'OK'){ | |
# Display the hyperlink info | |
my $hyperlink = $response->{'Hyperlink'}; | |
print("\nDisplay Text: ". $hyperlink->{'DisplayText'}. " Value: " . $hyperlink->{'Value'} . " link: " . $hyperlink->{'link'}->{'Href'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get all the hyperlinks in a word document | |
$response = $wordsApi->GetDocumentHyperlinks(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Display the hyperlinks info | |
foreach my $hyperlink (@{$response->{'Hyperlinks'}->{'HyperlinkList'}}){ | |
print("\nDisplay Text: ". $hyperlink->{'DisplayText'}. " Value: " . $hyperlink->{'Value'} . " link: " . $hyperlink->{'link'}->{'Href'}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleExecuteTemplate.doc'; | |
my $filedataname = "SampleExecuteTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge template and populate a word document from XML data | |
$response = $wordsApi->PostExecuteTemplate(name=> $name, file=>$data_path.$filedataname, filename=>$destfilename); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully"; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleExecuteTemplate.doc'; | |
my $filedataname = "SampleExecuteTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge template and populate a word document from XML data | |
$response = $wordsApi->PostExecuteTemplate(name=> $name, file=>$data_path.$filedataname, filename=>$destfilename, storage=>$storage); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully"; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename, storage=>$storage); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleMailMergeTemplate.docx'; | |
my $filedataname = "SampleMailMergeTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
$response = $wordsApi->PostDocumentExecuteMailMerge(name=> $name, filename=>$destfilename, file=>$data_path.$filedataname, withRegions=>'False'); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully"; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleMailMergeTemplate.docx'; | |
my $filedataname = "SampleMailMergeTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
$response = $wordsApi->PostDocumentExecuteMailMerge(name=> $name, storage=>$storage, filename=>$destfilename, file=>$data_path.$filedataname, withRegions=>'False'); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully"; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename, storage=>$storage); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleInvoiceTemplate.doc'; | |
my $filedataname = "SampleInvoiceTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
$response = $wordsApi->PostDocumentExecuteMailMerge(name=> $name, file=>$data_path.$filedataname, withRegions=>'True'); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully."; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleInvoiceTemplate.doc'; | |
my $filedataname = "SampleInvoiceTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
$response = $wordsApi->PostDocumentExecuteMailMerge(name=> $name, storage=>$storage, file=>$data_path.$filedataname, withRegions=>'True'); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully."; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename, storage=>$storage); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleMailMergeTemplateImage.doc'; | |
my $filedataname = "SampleMailMergeTemplateImageData.txt"; | |
my $destfilename = "updated-" . $name; | |
my $logofile = "header-logo.png"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge and populate a word document from XML data | |
$response = $wordsApi->PostDocumentExecuteMailMerge(name=> $name, filename=>$destfilename, file=>$data_path.$filedataname, withRegions=>'False'); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge template has been executed successfully"; | |
# Download updated document from storage server | |
$response = $storageApi->GetDownload(Path => $destfilename); | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleMailMergeTemplate.docx'; | |
my $filedataname = "SampleMailMergeTemplateData.txt"; | |
my $destfilename = "updated-" . $name; | |
# Invoke Aspose.Words Cloud SDK API to execute mail merge online and populate a word document from XML data | |
my $response = $wordsApi->PutExecuteMailMergeOnline(withRegions => 'False', file => $data_path.$name, data=>$data_path.$filedataname); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nmail merge online template has been executed successfully."; | |
# Download updated document from response | |
my $output_file = $out_path. $destfilename; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $sectionIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get page setup properties by given section index from a word document | |
$response = $wordsApi->GetSectionPageSetup(name=> $name, sectionIndex=>$sectionIndex); | |
if($response->{'Status'} eq 'OK'){ | |
my $secPageSetup = $response->{'PageSetup'}; | |
print "\nPaperSize : " . $secPageSetup->{'PaperSize'} . " Orientation: " . $secPageSetup->{'Orientation'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::PageSetup; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $pageNumber = 1; | |
my $format = 'bmp'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to render page to specified format | |
$response = $wordsApi->GetRenderPage(name=> $name, pageNumber=>$pageNumber, format=>$format); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nRender page to specified format, Done!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::PageSetup; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $sectionIndex = 0; | |
my $pageSetup = AsposeWordsCloud::Object::PageSetup->new( | |
'RtlGutter' => 'True', | |
'LeftMargin' => 10.0, | |
'Orientation' => 'Landscape', | |
'PaperSize' => 'A5' | |
); | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to update page setup properties by given section index from a word document | |
$response = $wordsApi->UpdateSectionPageSetup(name=> $name, sectionIndex=>$sectionIndex, body=>$pageSetup); | |
if($response->{'Status'} eq 'OK'){ | |
my $secPageSetup = $response->{'PageSetup'}; | |
print "\nPaperSize : " . $secPageSetup->{'PaperSize'} . " Orientation: " . $secPageSetup->{'Orientation'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $index = 0; | |
my $runIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get a font related information of a specific run of a paragraph from a word document | |
$response = $wordsApi->GetDocumentParagraphRunFont(name=> $name, index=>$index, runIndex=>$runIndex); | |
if($response->{'Status'} eq 'OK'){ | |
my $docParagraph = $response->{'Font'}; | |
print "\nFont Name : " . $docParagraph->{'Name'} . " Style: " . $docParagraph->{'StyleName'}. " Size: " . $docParagraph->{'Size'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get list of paragraphs from a word document | |
$response = $wordsApi->GetDocumentParagraphs(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Display document paragraphs info | |
foreach my $docParagraphLink (@{$response->{'Paragraphs'}->{'ParagraphLinkList'}}){ | |
print "\nText : " . $docParagraphLink->{'Text'} . " Link: " . $docParagraphLink->{'link'}->{'Href'}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $index = 1; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get a specific paragraph from a word document | |
$response = $wordsApi->GetDocumentParagraph(name=> $name, index=>$index); | |
if($response->{'Status'} eq 'OK'){ | |
my $docParagraph = $response->{'Paragraph'}; | |
print "\nNoteId : " . $docParagraph->{'NodeId'} . " Link: " . $docParagraph->{'link'}->{'Href'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $index = 0; | |
my $runIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get a specific run of a paragraph from a word document | |
$response = $wordsApi->GetDocumentParagraphRun(name=> $name, index=>$index, runIndex=>$runIndex); | |
if($response->{'Status'} eq 'OK'){ | |
my $docParagraphRun = $response->{'Run'}; | |
print "\nNoteId : " . $docParagraphRun->{'NodeId'} . " Text: " . $docParagraphRun->{'Text'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'GetField.docx'; | |
my $sectionIndex = 0; | |
my $paragraphIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to read all Runs from a Paragraph in a Word Document | |
$response = $wordsApi->GetParagraphRuns(name=> $name, sectionIndex=>$sectionIndex, paragraphIndex =>$paragraphIndex); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nRead all Runs from a Paragraph in a Word Document, Done!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::Font; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $index = 0; | |
my $runIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $font = AsposeWordsCloud::Object::Font->new('Name' => 'Calibri', 'Bold' => 'True', 'Size' => 31.0); | |
# Invoke Aspose.Words Cloud SDK API to update font of a specific run of a paragraph present in a word document | |
$response = $wordsApi->PostDocumentParagraphRunFont(name=> $name, index=>$index, runIndex=>$runIndex, body=>$font); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nparagraph run font has been updated successfully"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::ProtectionRequest; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleProtectedBlankWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $protectionRequest = AsposeWordsCloud::Object::ProtectionRequest->new('Password' => 'aspose','NewPassword' => '', 'ProtectionType' => 'NoProtection'); | |
# Invoke Aspose.Words Cloud SDK API to unprotect a word document | |
$response = $wordsApi->PostChangeDocumentProtection(name=> $name, body=>$protectionRequest); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument protection property has been changed from protected to unprotected successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path. 'unprotected-' .$name; | |
$response = $storageApi->GetDownload(Path => $name);; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::ProtectionRequest; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleProtectedBlankWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $protectionRequest = AsposeWordsCloud::Object::ProtectionRequest->new('Password' => 'aspose'); | |
# Invoke Aspose.Words Cloud SDK API to un-protect a word document | |
$response = $wordsApi->DeleteUnprotectDocument(name=> $name, body=>$protectionRequest); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been unprotected successfully."; | |
# Download updated document from storage server | |
my $output_file = 'C:/temp/'. 'unprotected-' .$name; | |
$response = $storageApi->GetDownload(Path => $name);; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get list of all sections present from a word document | |
$response = $wordsApi->GetSections(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
foreach my $item (@{$response->{'Sections'}->{'SectionLinkList'}}){ | |
print "\nSection Href : " . $item->{'link'}->{'Href'}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $sectionIndex = 0; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get a specific section present from a word document | |
$response = $wordsApi->GetSection(name=> $name, sectionIndex=>$sectionIndex); | |
if($response->{'Status'} eq 'OK'){ | |
# Display document protection info | |
print "\nSection Href : " . $response->{'Section'}->{'link'}->{'Href'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to get text items from a word document | |
$response = $wordsApi->GetDocumentTextItems(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
# Get all the TextItem's text | |
foreach my $textItem (@{$response->{'TextItems'}->{'List'}}){ | |
print "\n$textItem->{'Text'}"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::ReplaceTextRequest; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $replaceTextRequest = AsposeWordsCloud::Object::ReplaceTextRequest->new('OldValue' => 'aspose', 'NewValue' => 'aspose.com'); | |
# Invoke Aspose.Words Cloud SDK API to replace text from a given a Word document | |
$response = $wordsApi->PostReplaceText(name=> $name, body=>$replaceTextRequest); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been updated successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path.$name; | |
$response = $storageApi->GetDownload(Path => $name);; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::ReplaceTextRequest; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleWordDocument.docx'; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
my $replaceTextRequest = AsposeWordsCloud::Object::ReplaceTextRequest->new('OldValue' => 'aspose', 'NewValue' => 'aspose.com'); | |
# Invoke Aspose.Words Cloud SDK API to replace text from a given a Word document | |
$response = $wordsApi->PostReplaceText(name=> $name, storage=>$storage, body=>$replaceTextRequest); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nDocument has been updated successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path.$name; | |
$response = $storageApi->GetDownload(Path => $name, storage=>$storage); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleBlankWordDocument.docx'; | |
my $image = "aspose-cloud.png"; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
# Invoke Aspose.Words Cloud SDK API to remove add watermark image in a word document | |
$response = $wordsApi->PostInsertWatermarkImage(name=> $name, storage=>$storage, file => $data_path.$image); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nWatermark image has been added successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path.$name; | |
$response = $storageApi->GetDownload(Path => $name, storage=>$storage); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
use AsposeWordsCloud::Object::WatermarkText; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleBlankWordDocument.docx'; | |
my $storage = "AsposeDropboxStorage"; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, storage=>$storage, file => $data_path.$name); | |
my $watermarkText = AsposeWordsCloud::Object::WatermarkText->new('Text' => 'Welcome Aspose', 'RotationAngle' => '45'); | |
# Invoke Aspose.Words Cloud SDK API to add watermark text in a word document | |
$response = $wordsApi->PostInsertWatermarkText(name=> $name, body=>$watermarkText, storage=>$storage); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nWatermark text has been added successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path.$name; | |
$response = $storageApi->GetDownload(Path => $name, storage=>$storage); | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-words-cloud | |
use lib 'lib'; | |
use strict; | |
use warnings; | |
use utf8; | |
use File::Slurp; # From CPAN | |
use JSON; | |
use AsposeStorageCloud::StorageApi; | |
use AsposeStorageCloud::ApiClient; | |
use AsposeStorageCloud::Configuration; | |
use AsposeWordsCloud::WordsApi; | |
use AsposeWordsCloud::ApiClient; | |
use AsposeWordsCloud::Configuration; | |
my $configFile = '../Config/config.json'; | |
my $configPropsText = read_file($configFile); | |
my $configProps = decode_json($configPropsText); | |
my $data_path = '../../../Data/'; | |
my $out_path = $configProps->{'out_folder'}; | |
$AsposeWordsCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeWordsCloud::Configuration::api_key = $configProps->{'api_key'}; | |
$AsposeWordsCloud::Configuration::debug = 1; | |
$AsposeStorageCloud::Configuration::app_sid = $configProps->{'app_sid'}; | |
$AsposeStorageCloud::Configuration::api_key = $configProps->{'api_key'}; | |
# Instantiate Aspose.Storage and Aspose.Words API SDK | |
my $storageApi = AsposeStorageCloud::StorageApi->new(); | |
my $wordsApi = AsposeWordsCloud::WordsApi->new(); | |
# Set input file name | |
my $name = 'SampleBlankWatermarkDocument.docx'; | |
# Upload file to aspose cloud storage | |
my $response = $storageApi->PutCreate(Path => $name, file => $data_path.$name); | |
my $replaceTextRequest = AsposeWordsCloud::Object::ReplaceTextRequest->new('OldValue' => 'aspose', 'NewValue' => 'aspose.com'); | |
# Invoke Aspose.Words Cloud SDK API to remove watermark image from a word document | |
$response = $wordsApi->DeleteDocumentWatermark(name=> $name); | |
if($response->{'Status'} eq 'OK'){ | |
print "\nWatermark image has been removed successfully."; | |
# Download updated document from storage server | |
my $output_file = $out_path.$name; | |
$response = $storageApi->GetDownload(Path => $name);; | |
write_file($output_file, { binmode => ":raw" }, $response->{'Content'}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment