Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This gist exceeds the recommended number of files (~10). To access all files, please clone this gist.
This Gist contains Golang code samples for Aspose.Words Cloud API
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
acceptRequestOptions := map[string]interface{}{}
acceptRequest := &models.AcceptAllRevisionsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: acceptRequestOptions,
}
_, _, _ = wordsApi.AcceptAllRevisions(ctx, acceptRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
acceptRequestOptions := map[string]interface{}{}
acceptRequest := &models.AcceptAllRevisionsOnlineRequest{
Document: requestDocument,
Optionals: acceptRequestOptions,
}
_, _, _ = wordsApi.AcceptAllRevisionsOnline(ctx, acceptRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
remoteFileName:= "Sample.docx"
requestDocumentListDocumentEntries0 := models.DocumentEntry{
Href: ToStringPointer(remoteFileName),
ImportFormatMode: ToStringPointer("KeepSourceFormatting"),
}
requestDocumentListDocumentEntries := []models.DocumentEntry{
requestDocumentListDocumentEntries0,
}
requestDocumentList := models.DocumentEntryList{
DocumentEntries: requestDocumentListDocumentEntries,
}
appendRequestOptions := map[string]interface{}{}
appendRequest := &models.AppendDocumentRequest{
Name: ToStringPointer(remoteFileName),
DocumentList: &requestDocumentList,
Optionals: appendRequestOptions,
}
_, _, _ = wordsApi.AppendDocument(ctx, appendRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestDocumentListDocumentEntries0 := models.DocumentEntry{
Href: ToStringPointer("Sample.docx"),
ImportFormatMode: ToStringPointer("KeepSourceFormatting"),
}
requestDocumentListDocumentEntries := []models.DocumentEntry{
requestDocumentListDocumentEntries0,
}
requestDocumentList := models.DocumentEntryList{
DocumentEntries: requestDocumentListDocumentEntries,
}
appendRequestOptions := map[string]interface{}{}
appendRequest := &models.AppendDocumentOnlineRequest{
Document: requestDocument,
DocumentList: &requestDocumentList,
Optionals: appendRequestOptions,
}
_, _, _ = wordsApi.AppendDocumentOnline(ctx, appendRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestStyleApply := models.StyleApply{
StyleName: ToStringPointer("Heading 1"),
}
applyStyleRequestOptions := map[string]interface{}{}
applyStyleRequest := &models.ApplyStyleToDocumentElementRequest{
Name: ToStringPointer("Sample.docx"),
StyledNodePath: ToStringPointer("paragraphs/1/paragraphFormat"),
StyleApply: &requestStyleApply,
Optionals: applyStyleRequestOptions,
}
_, _, _ = wordsApi.ApplyStyleToDocumentElement(ctx, applyStyleRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestStyleApply := models.StyleApply{
StyleName: ToStringPointer("Heading 1"),
}
applyStyleRequestOptions := map[string]interface{}{}
applyStyleRequest := &models.ApplyStyleToDocumentElementOnlineRequest{
Document: requestDocument,
StyledNodePath: ToStringPointer("paragraphs/1/paragraphFormat"),
StyleApply: &requestStyleApply,
Optionals: applyStyleRequestOptions,
}
_, _, _ = wordsApi.ApplyStyleToDocumentElementOnline(ctx, applyStyleRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestReportEngineSettingsReportBuildOptions := []string{
"AllowMissingMembers",
"RemoveEmptyParagraphs",
}
requestReportEngineSettings := models.ReportEngineSettings{
DataSourceType: ToStringPointer("Json"),
ReportBuildOptions: requestReportEngineSettingsReportBuildOptions,
}
buildReportRequestOptions := map[string]interface{}{}
buildReportRequest := &models.BuildReportRequest{
Name: ToStringPointer("Sample.docx"),
Data: ToStringPointer("Data.json"),
ReportEngineSettings: &requestReportEngineSettings,
Optionals: buildReportRequestOptions,
}
_, _, _ = wordsApi.BuildReport(ctx, buildReportRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestTemplate, _ := os.Open("Sample.docx")
requestReportEngineSettings := models.ReportEngineSettings{
DataSourceType: ToStringPointer("Json"),
DataSourceName: ToStringPointer("persons"),
}
buildReportRequestOptions := map[string]interface{}{}
buildReportRequest := &models.BuildReportOnlineRequest{
Template: requestTemplate,
Data: ToStringPointer("Data.json"),
ReportEngineSettings: &requestReportEngineSettings,
Optionals: buildReportRequestOptions,
}
_, _ = wordsApi.BuildReportOnline(ctx, buildReportRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
classifyRequestOptions := map[string]interface{}{"bestClassesCount": "3",}
classifyRequest := &models.ClassifyRequest{
Text: ToStringPointer("Try text classification"),
Optionals: classifyRequestOptions,
}
_, _, _ = wordsApi.Classify(ctx, classifyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
classifyRequestOptions := map[string]interface{}{"bestClassesCount": "3",}
classifyRequest := &models.ClassifyDocumentRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: classifyRequestOptions,
}
_, _, _ = wordsApi.ClassifyDocument(ctx, classifyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
classifyRequestOptions := map[string]interface{}{"bestClassesCount": "3",}
classifyRequest := &models.ClassifyDocumentOnlineRequest{
Document: requestDocument,
Optionals: classifyRequestOptions,
}
_, _, _ = wordsApi.ClassifyDocumentOnline(ctx, classifyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestCompareData := models.CompareData{
Author: ToStringPointer("author"),
ComparingWithDocument: ToStringPointer("TestCompareDocument2.doc"),
DateTime: ToTimePointer(CreateTime(2015, 10, 26, 0, 0, 0)),
}
compareRequestOptions := map[string]interface{}{"destFileName": "CompareDocumentOut.doc",}
compareRequest := &models.CompareDocumentRequest{
Name: ToStringPointer("TestCompareDocument1.doc"),
CompareData: &requestCompareData,
Optionals: compareRequestOptions,
}
_, _, _ = wordsApi.CompareDocument(ctx, compareRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("compareTestDoc1.doc")
requestCompareData := models.CompareData{
Author: ToStringPointer("author"),
ComparingWithDocument: ToStringPointer("TestCompareDocument2.doc"),
DateTime: ToTimePointer(CreateTime(2015, 10, 26, 0, 0, 0)),
}
requestComparingDocument, _ := os.Open("compareTestDoc2.doc")
compareRequestOptions := map[string]interface{}{"comparingDocument": requestComparingDocument,
"destFileName": "CompareDocumentOut.doc",}
compareRequest := &models.CompareDocumentOnlineRequest{
Document: requestDocument,
CompareData: &requestCompareData,
Optionals: compareRequestOptions,
}
_, _, _ = wordsApi.CompareDocumentOnline(ctx, compareRequest)
{
"ClientId": "####-####-####-####-####",
"ClientSecret": "##################",
"BaseUrl": "https://api.aspose.cloud"
}
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
convertRequestOptions := map[string]interface{}{}
convertRequest := &models.ConvertDocumentRequest{
Document: requestDocument,
Format: ToStringPointer("pdf"),
Optionals: convertRequestOptions,
}
_, _ = wordsApi.ConvertDocument(ctx, convertRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
convertRequestOptions := map[string]interface{}{}
convertRequest := &models.ConvertDocumentRequest{
Document: requestDocument,
Format: ToStringPointer("pdf"),
Optionals: convertRequestOptions,
}
_, _ = wordsApi.ConvertDocument(ctx, convertRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
convertRequestOptions := map[string]interface{}{}
convertRequest := &models.ConvertDocumentRequest{
Document: requestDocument,
Format: ToStringPointer("pdf"),
Optionals: convertRequestOptions,
}
_, _ = wordsApi.ConvertDocument(ctx, convertRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
copyRequestOptions := map[string]interface{}{}
copyRequest := &models.CopyFileRequest{
DestPath: ToStringPointer("Copy.docx"),
SrcPath: ToStringPointer("Sample.docx"),
Optionals: copyRequestOptions,
}
_, _ = wordsApi.CopyFile(ctx, copyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
folderToCopy:= "/TestCopyFolder"
copyRequestOptions := map[string]interface{}{}
copyRequest := &models.CopyFolderRequest{
DestPath: ToStringPointer(folderToCopy + "Dest"),
SrcPath: ToStringPointer(folderToCopy + "Src"),
Optionals: copyRequestOptions,
}
_, _ = wordsApi.CopyFolder(ctx, copyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestStyleCopy := models.StyleCopy{
StyleName: ToStringPointer("Heading 1"),
}
copyRequestOptions := map[string]interface{}{}
copyRequest := &models.CopyStyleRequest{
Name: ToStringPointer("Sample.docx"),
StyleCopy: &requestStyleCopy,
Optionals: copyRequestOptions,
}
_, _, _ = wordsApi.CopyStyle(ctx, copyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestStyleCopy := models.StyleCopy{
StyleName: ToStringPointer("Heading 1"),
}
copyRequestOptions := map[string]interface{}{}
copyRequest := &models.CopyStyleOnlineRequest{
Document: requestDocument,
StyleCopy: &requestStyleCopy,
Optionals: copyRequestOptions,
}
_, _, _ = wordsApi.CopyStyleOnline(ctx, copyRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
createRequestOptions := map[string]interface{}{"fileName": "Sample.docx",}
createRequest := &models.CreateDocumentRequest{
Optionals: createRequestOptions,
}
_, _, _ = wordsApi.CreateDocument(ctx, createRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
createRequestOptions := map[string]interface{}{}
createRequest := &models.CreateFolderRequest{
Path: ToStringPointer("/TestCreateFolder"),
Optionals: createRequestOptions,
}
_, _ = wordsApi.CreateFolder(ctx, createRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestProperty := models.DocumentPropertyCreateOrUpdate{
Value: ToStringPointer("John Doe"),
}
createRequestOptions := map[string]interface{}{}
createRequest := &models.CreateOrUpdateDocumentPropertyRequest{
Name: ToStringPointer("Sample.docx"),
PropertyName: ToStringPointer("AsposeAuthor"),
Property: &requestProperty,
Optionals: createRequestOptions,
}
_, _, _ = wordsApi.CreateOrUpdateDocumentProperty(ctx, createRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestProperty := models.DocumentPropertyCreateOrUpdate{
Value: ToStringPointer("John Doe"),
}
createRequestOptions := map[string]interface{}{}
createRequest := &models.CreateOrUpdateDocumentPropertyOnlineRequest{
Document: requestDocument,
PropertyName: ToStringPointer("AsposeAuthor"),
Property: &requestProperty,
Optionals: createRequestOptions,
}
_, _, _ = wordsApi.CreateOrUpdateDocumentPropertyOnline(ctx, createRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteAllParagraphTabStopsRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteAllParagraphTabStops(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteAllParagraphTabStopsOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteAllParagraphTabStopsOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
deleteRequest := &models.DeleteBorderRequest{
Name: ToStringPointer("Sample.docx"),
BorderType: ToStringPointer("left"),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteBorder(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
deleteRequest := &models.DeleteBorderOnlineRequest{
Document: requestDocument,
BorderType: ToStringPointer("left"),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteBorderOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
deleteRequest := &models.DeleteBordersRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteBorders(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
deleteRequest := &models.DeleteBordersOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteBordersOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCommentRequest{
Name: ToStringPointer("Sample.docx"),
CommentIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteComment(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCommentOnlineRequest{
Document: requestDocument,
CommentIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteCommentOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCommentsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteComments(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCommentsOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteCommentsOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCustomXmlPartRequest{
Name: ToStringPointer("Sample.docx"),
CustomXmlPartIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteCustomXmlPart(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCustomXmlPartOnlineRequest{
Document: requestDocument,
CustomXmlPartIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteCustomXmlPartOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCustomXmlPartsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteCustomXmlParts(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteCustomXmlPartsOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteCustomXmlPartsOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteDocumentPropertyRequest{
Name: ToStringPointer("Sample.docx"),
PropertyName: ToStringPointer("testProp"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteDocumentProperty(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteDocumentPropertyOnlineRequest{
Document: requestDocument,
PropertyName: ToStringPointer("testProp"),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteDocumentPropertyOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteDrawingObjectRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteDrawingObject(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteDrawingObjectOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteDrawingObjectOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFieldRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteField(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{"nodePath": "sections/0/paragraphs/0",}
deleteRequest := &models.DeleteFieldOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteFieldOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFieldsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteFields(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFieldsOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteFieldsOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFileRequest{
Path: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteFile(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFolderRequest{
Path: ToStringPointer(""),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteFolder(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFootnoteRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteFootnote(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.doc")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFootnoteOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteFootnoteOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteFormFieldRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteFormField(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{"nodePath": "sections/0",}
deleteRequest := &models.DeleteFormFieldOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteFormFieldOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteHeaderFooterRequest{
Name: ToStringPointer("Sample.docx"),
SectionPath: ToStringPointer(""),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteHeaderFooter(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.doc")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteHeaderFooterOnlineRequest{
Document: requestDocument,
SectionPath: ToStringPointer(""),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteHeaderFooterOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteHeadersFootersRequest{
Name: ToStringPointer("Sample.docx"),
SectionPath: ToStringPointer(""),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteHeadersFooters(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.doc")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteHeadersFootersOnlineRequest{
Document: requestDocument,
SectionPath: ToStringPointer(""),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteHeadersFootersOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteMacrosRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteMacros(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteMacrosOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteMacrosOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteOfficeMathObjectRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteOfficeMathObject(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteOfficeMathObjectOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteOfficeMathObjectOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteParagraph(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphListFormatRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteParagraphListFormat(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.doc")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphListFormatOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteParagraphListFormatOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteParagraphOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphTabStopRequest{
Name: ToStringPointer("Sample.docx"),
Position: ToFloat64Pointer(72.0),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteParagraphTabStop(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteParagraphTabStopOnlineRequest{
Document: requestDocument,
Position: ToFloat64Pointer(72.0),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteParagraphTabStopOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteRunRequest{
Name: ToStringPointer("Sample.docx"),
ParagraphPath: ToStringPointer("paragraphs/1"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteRun(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.doc")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteRunOnlineRequest{
Document: requestDocument,
ParagraphPath: ToStringPointer("paragraphs/1"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteRunOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteSectionRequest{
Name: ToStringPointer("Sample.docx"),
SectionIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteSection(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteSectionOnlineRequest{
Document: requestDocument,
SectionIndex: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteSectionOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableRequest{
Name: ToStringPointer("Sample.docx"),
Index: ToInt32Pointer(int32(1)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteTable(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableCellRequest{
Name: ToStringPointer("Sample.docx"),
TableRowPath: ToStringPointer("sections/0/tables/2/rows/0"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteTableCell(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableCellOnlineRequest{
Document: requestDocument,
TableRowPath: ToStringPointer("sections/0/tables/2/rows/0"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteTableCellOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableOnlineRequest{
Document: requestDocument,
Index: ToInt32Pointer(int32(1)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteTableOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableRowRequest{
Name: ToStringPointer("Sample.docx"),
TablePath: ToStringPointer("tables/1"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _ = wordsApi.DeleteTableRow(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteTableRowOnlineRequest{
Document: requestDocument,
TablePath: ToStringPointer("tables/1"),
Index: ToInt32Pointer(int32(0)),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteTableRowOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteWatermarkRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteWatermark(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
deleteRequestOptions := map[string]interface{}{}
deleteRequest := &models.DeleteWatermarkOnlineRequest{
Document: requestDocument,
Optionals: deleteRequestOptions,
}
_, _, _ = wordsApi.DeleteWatermarkOnline(ctx, deleteRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
downloadRequestOptions := map[string]interface{}{}
downloadRequest := &models.DownloadFileRequest{
Path: ToStringPointer("Sample.docx"),
Optionals: downloadRequestOptions,
}
_, _ = wordsApi.DownloadFile(ctx, downloadRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptionsCurrentUser := models.UserInformation{
Name: ToStringPointer("SdkTestUser"),
}
requestOptions := models.FieldOptions{
CurrentUser: &requestOptionsCurrentUser,
}
mailMergeRequestOptions := map[string]interface{}{"data": ReadFile(t, "TestMailMergeData.xml"),
"options": &requestOptions,}
mailMergeRequest := &models.ExecuteMailMergeRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: mailMergeRequestOptions,
}
_, _, _ = wordsApi.ExecuteMailMerge(ctx, mailMergeRequest)
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
filePath := "SampleMailMergeTemplate.docx"
// Open template
file, err := os.Open(filePath)
if err != nil {
fmt.Println(err)
}
// Upload template
_, _, err1 := wordsApi.UploadFile(ctx, file, "SampleMailMergeTemplate.docx", nil)
if err1 != nil {
fmt.Println(err1)
}
var jsonStr = `{
"storage": "First Storage",
"data": {
"root": {
"data": {
"format": "html",
"htmlText": "<html><head><style type="text/css">h2{color:green} .color_red{color:red} .color_green{color:green} .color_magenta{color:magenta} .color_olive{color:olive} .color_teal{color:teal}</style></head><body><h2>Table</h2><table border="2" cellspacing="0" cellpadding="4"><tr><th class="color_red">Column 1</th><th class="color_green">Column 2</th></tr><tr><td class="color_magenta">Value 1.1</td><td class="color_olive">Value 1.2</td></tr><tr><td class="color_teal">Value 2.1</td></tr></table><h2>Div</h2><div class="color_olive">Outer text<div class="color_magenta">Inner text</div>Outer text</div><h2>Image</h2><br/><img src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAADUUlEQVR42lWTWUwTURSGaUtIKY5QweISTUzceDGu0Rj1xURjTNQEE+ODGn0hPhBEQdqZztahBbrAtFih1Fprh9IBiVLLErZSU7BUoS7VqNH44ovx0S0ovdfO4Ez04cw9Ofec7/5zzr15NEnkUxSVFx8ObZ1x7nzHN6z9nOhnzOFwWCnECcKoEFbBRrrp6iF/XRvD0BoplkdTuAiIhtt3P3Fu+jJlKlkM1WoXLFjVeSnpXrC94gV3ciJp1X0L1K7+NtDfvXdpj1TmmUwm8QTfLa867T+ceWTSwO5r5b87XNaDEoBrv3p2Ai+AU1Qh5OiDGS4UXi4roAisQHBiYfJS2obAVPMyELYcGxViOIaKcLaNLXzadej5nBUBPXW6hdYW0z4RQOYUXK2tUfr8QeXL0Kn4JKEBk7QWdtrrLggJJEmoCBxVCf50qIaaa0HABFkEPZaLNnGfwPNFGV0u05Y554bvMQoBPLbxs9t9QydJpHP/KayRbsf+pG1NdgTTgDuGXa8dbS41ZtArxaQYT1WlHVqYaloGOcvJIan4X2MdViTl3vExbS+GPfXlvzzutj1LPch9HrYea59t0YIRtAAO+PQuIWYwNKikYty41Iuk/3TvMzsCB9HcQR7msgzgjZs7Z5rLQPR6PojeJW2d3oDCoG/IlwAYqlexbp/i9eB19ziuBoMoAlrR03YZ0G8+0JFhS8EjuhD6zWfuCTEjppcBOKYX1bwaqA5MM2oYZ4pBy7XjrAyY7sPqU01FcNZW/jtwZeXXVpt5u1RM4JhYzHFBddqz5/28fUU2NwngtVUbZUCE79o6x67/MYiXLiSbS8D9xp1vI7znkLvDK07A5/MiT7mzdxMMAsdMqxaiWDHkgzePigBUXy9KTfdWeVKNSjjPrvv5uKkYxszlIHX7eDLeVfkgbt30bt5eAlOOtT9nLRrI03szrOumOtcb4SrTSj2KKfr4nuUZ7kR8HFPAYXLlYqxRl43TGjjTWAhHCC1MNK/+lWA0cJLRgfsh95G/N1H136z7+BCSuHMuMEGVLo4a1XCKKcuO0WXZBw1FcNighmPWbe8jIeeJpdFiCrkHguWUyM92NBKseBut8T92bfsw66z49IyrHH2T5CvlqeCYUvL/ANIZ7+ohXSdWAAAAAElFTkSuQmCC"></body></html>"
}
}
},
"destFileName": "Out_SampleMailMergeTemplate.docx"
}`
// Populate map[string]interface{}
jsonMap := make(map[string]interface{})
json.Unmarshal([]byte(jsonStr), &jsonMap)
// Populate mail merge template (The output doc will be saved in cloud storage)
_, response, _ := wordsApi.ExecuteMailMerge(ctx, "SampleMailMergeTemplate.docx", jsonMap)
fmt.Println(response.Status)
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
filePath := "SampleMailMergeTemplate.docx"
// Open template
file, err := os.Open(filePath)
if err != nil {
fmt.Println(err)
}
// Upload template
_, _, err1 := wordsApi.UploadFile(ctx, file, "SampleMailMergeTemplate.docx", nil)
if err1 != nil {
fmt.Println(err1)
}
var jsonStr = `{
"storage":"First Storage",
"data": "<Fields><FullName>abc user</FullName><Company>Aspose Pty Ltd</Company><Address>Suite 163</Address><Address2>79 Longueville Road</Address2><City>Lane Cove</City></Fields>",
"loadEncoding":"utf8",
"destFileName":"Out_SampleMailMergeTemplate.docx"
}`
// Populate map[string]interface{}
jsonMap := make(map[string]interface{})
json.Unmarshal([]byte(jsonStr), &jsonMap)
// Convert Document to html (The output doc will be saved in cloud storage)
_, response, _ := wordsApi.ExecuteMailMerge(ctx, "SampleMailMergeTemplate.docx", jsonMap)
fmt.Println(response.Status)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestTemplate, _ := os.Open("Sample.docx")
requestData, _ := os.Open(ReadFile(t, "TestMailMergeData.xml"))
requestOptionsCurrentUser := models.UserInformation{
Name: ToStringPointer("SdkTestUser"),
}
requestOptions := models.FieldOptions{
CurrentUser: &requestOptionsCurrentUser,
}
mailMergeRequestOptions := map[string]interface{}{"options": &requestOptions,}
mailMergeRequest := &models.ExecuteMailMergeOnlineRequest{
Template: requestTemplate,
Data: requestData,
Optionals: mailMergeRequestOptions,
}
_, _ = wordsApi.ExecuteMailMergeOnline(ctx, mailMergeRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestTemplate, _ := os.Open("TestMailMergeWithImages.doc")
requestData, _ := os.Open("MailMergeData.json")
mailMergeRequestOptions := map[string]interface{}{"documentFileName": "Out_TestMailMergeWithImages.doc",}
mailMergeRequest := &models.ExecuteMailMergeOnlineRequest{
Template: requestTemplate,
Data: requestData,
Optionals: mailMergeRequestOptions,
}
_, _ = wordsApi.ExecuteMailMergeOnline(ctx, mailMergeRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestTemplate, _ := os.Open("template.doc")
requestData, _ := os.Open("TestPostDocumentExecuteMailMerge.txt")
mailMergeRequestOptions := map[string]interface{}{"documentFileName": "Out_PostDocumentExecuteMailMergeWithHTMLData.docx",}
mailMergeRequest := &models.ExecuteMailMergeOnlineRequest{
Template: requestTemplate,
Data: requestData,
Optionals: mailMergeRequestOptions,
}
_, _ = wordsApi.ExecuteMailMergeOnline(ctx, mailMergeRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestTemplate, _ := os.Open("SampleMailMergeTemplate.docx")
requestData, _ := os.Open("SampleMailMergeTemplateData.xml")
mailMergeRequestOptions := map[string]interface{}{"documentFileName": "Out_SampleMailMergeTemplate.docx",}
mailMergeRequest := &models.ExecuteMailMergeOnlineRequest{
Template: requestTemplate,
Data: requestData,
Optionals: mailMergeRequestOptions,
}
_, _ = wordsApi.ExecuteMailMergeOnline(ctx, mailMergeRequest)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetAvailableFontsRequest{
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetAvailableFonts(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetBookmarkByNameRequest{
Name: ToStringPointer("Sample.docx"),
BookmarkName: ToStringPointer("aspose"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBookmarkByName(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{}
request := &models.GetBookmarkByNameOnlineRequest{
Document: requestDocument,
BookmarkName: ToStringPointer("aspose"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBookmarkByNameOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetBookmarksRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBookmarks(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{}
request := &models.GetBookmarksOnlineRequest{
Document: requestDocument,
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBookmarksOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
request := &models.GetBorderRequest{
Name: ToStringPointer("Sample.docx"),
BorderType: ToStringPointer("left"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBorder(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
request := &models.GetBorderOnlineRequest{
Document: requestDocument,
BorderType: ToStringPointer("left"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBorderOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
request := &models.GetBordersRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBorders(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{"nodePath": "tables/1/rows/0/cells/0",}
request := &models.GetBordersOnlineRequest{
Document: requestDocument,
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetBordersOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetCommentRequest{
Name: ToStringPointer("Sample.docx"),
CommentIndex: ToInt32Pointer(int32(0)),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetComment(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{}
request := &models.GetCommentOnlineRequest{
Document: requestDocument,
CommentIndex: ToInt32Pointer(int32(0)),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetCommentOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetCommentsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetComments(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{}
request := &models.GetCommentsOnlineRequest{
Document: requestDocument,
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetCommentsOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetCustomXmlPartRequest{
Name: ToStringPointer("Sample.docx"),
CustomXmlPartIndex: ToInt32Pointer(int32(0)),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetCustomXmlPart(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Sample.docx")
requestOptions := map[string]interface{}{}
request := &models.GetCustomXmlPartOnlineRequest{
Document: requestDocument,
CustomXmlPartIndex: ToInt32Pointer(int32(0)),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetCustomXmlPartOnline(ctx, request)
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models")
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestOptions := map[string]interface{}{}
request := &models.GetCustomXmlPartsRequest{
Name: ToStringPointer("Sample.docx"),
Optionals: requestOptions,
}
_, _, _ = wordsApi.GetCustomXmlParts(ctx, request)