
Aspose.Words Cloud SKD for Go
Go REST API to Process Microsoft Word Documents
Go Word Documents Processing REST API to Generate, Modify, Manipulate, Render, Embed, Print & Convert Word Processing Documents (DOC, DOCX, RTF, HTML, PDF, XPS, EPUB).
What is Aspose.Words Cloud SDK for Go?
TheAspose.Words Cloud SDK for Go is a powerful solution for developers involved in Word processing app development via Go. This lightweight yet capable Go word processing API allows you to create, edit, and convert Microsoft Word documents directly in the cloud, without needing desktop software. Supporting a broad range of file types including DOC, DOCX, RTF, DOT, and FlatOPC (XML), this open source-inspired library helps streamline tasks such as document formatting, structure modification, and text extraction—perfect for developers building scalable, cloud-native word processing apps in Go.
Designed for flexibility, the SDK empowers developers to manipulate documents with precision—split and merge Word files, extract images and text, and convert DOCX or DOC formats into widely used outputs like PDF, HTML, and more. Whether you're building automated document pipelines or custom Go-based editors, this Go DOCX API makes complex Word processing and conversion tasks efficient. For developers seeking a reliable Go word processing library with extensive format support, Aspose.Words Cloud SDK for Go delivers practical tools to boost productivity across diverse projects.
Getting Started with Aspose.Words Cloud SKD for Go
The recommend way to install Aspose.Words Cloud SKD for Go is using GitHub. Please use the following command for a smooth installation.
Install Aspose.Words Cloud SKD for Go via GitHub
go get -v github.com/aspose-words-cloud/aspose-words-cloud-go/2007/api
Here You can download it directly from GitHub.Word Documents Creation via Go API
Aspose.Words Cloud SDK for Go makes it easy for software developers to create and manipulated word processing documents with just a couple of lines of code. The library allows software developers to generate a new document in the Cloud Storage in the format specified by the file extension. The library has included several important features related to Word documents creation, such as inserting text from the outer file, add images to an existing file, insert headers and footers, add tables, split large documents, add hyperlinks to Word documents, insert page numbers, add lists to Word documents, and many more.
How to Create a New Document via GO REST 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)
createRequestOptions := map[string]interface{}{"fileName": "Sample.docx",}
createRequest := &models.CreateDocumentRequest{
Optionals: createRequestOptions,
}
_, _, _ = wordsApi.CreateDocument(ctx, createRequest)
Word Documents Embedding in a Web Page
Aspose.Words Cloud SDK for Go has included a very powerful features for embedding Word documents inside a web page using Go commands. It just needs a single line code to embed a Word processing documents inside a web browser. Once the document is rendered by the cloud services, it will be displayed on your web pages as a JavaScript widget. It is very easy to zoom in and out it online. It is also possible to display various Word file formats, such DOC, DOCX, RTF, and so on.
How to Iframe Code Snippet Embed a DOCX Document into HTML?
<iframe width="1120"
height="850"
src="https://api.aspose.cloud/words/view?foldername=sample&filename=SampleDocument.docx">
</iframe>
Word Documents Comparison inside Go Apps
Aspose.Words Cloud SDK for Go enables software developers to compare multiple Word processing documents and track the changes made to it inside Go applications. The library has included a powerful document manipulation tool that helps software developers to compare two Word documents and retrieve a list of differences between the two Word documents such as deleted text, added text, formatting change and so on.
How to Compare Word Documents via Go 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)
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)
Manage Headers and Footers via Go API
Aspose.Words Cloud SDK for Go has included a very powerful feature for adding and managing headers and footers inside Word documents. The library supports several important features related headers and footers management, such as adding text or images to headers and footers, Delete a `HeaderFooter` object from a Word document online, get a Header/Footer in a Word document online, get a Header/Footer of a section, getting all headers/footers in a Word document, and many more. The following example demonstrates how to insert headers and footers in a Word documents.
How to Insert a Headers abd Footers into a Word document via Go 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)
requestDocument, _ := os.Open("Sample.doc")
insertRequestOptions := map[string]interface{}{}
insertRequest := &models.InsertHeaderFooterOnlineRequest{
Document: requestDocument,
SectionPath: ToStringPointer(""),
HeaderFooterType: ToStringPointer("FooterEven"),
Optionals: insertRequestOptions,
}
_, _, _ = wordsApi.InsertHeaderFooterOnline(ctx, insertRequest)