HTML
JPG
PDF
XML
DOCX
PDF
Make PDF in Go SDK
API for working with creating PDF documents using Aspose.PDF Cloud Go SDK
Get StartedHow to create PDF via Cloud Go SDK
To create PDF documents, we’ll use Aspose.PDF Cloud Go SDK This Cloud Go SDK assists Go programmers in developing cloud-based PDF creator, annotator, editor, and converter apps using Go programming language via Aspose.PDF REST API. This function effectively demonstrates how to create an empty PDF document using the Aspose.PDF Cloud SDK for Go and download it to a local directory. Use the following command from the Package Manager Console.
Package Manager Console Command
go get -u github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25
Steps to create PDF via Go
Aspose.PDF Cloud developers can easily load & create PDF in just a few lines of code.
- Initialize the Aspose.PDF API Client.
- Create an Empty PDF Document.
- Check for errors.
- Download the Created PDF Document.
Create PDF using Cloud Go SDK
package main
import (
"fmt"
"os"
"path"
asposepdfcloud "github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25"
)
func createPdfSimple() {
LOCAL_FOLDER := "c:\\Samples"
PDF_DOCUMENT := "output_created_simple.pdf"
// Initialize the Aspose.PDF API Client here.
_, httpResponse, err := pdfApi.PutCreateDocument(PDF_DOCUMENT, nil)
if err != nil {
fmt.Println(err.Error())
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
fmt.Println("Unexpected error!")
} else {
result_data, _, _ := pdfApi.DownloadFile(PDF_DOCUMENT, nil)
fileName := path.Join(LOCAL_FOLDER, PDF_DOCUMENT)
f, _ := os.Create(fileName)
_, _ = f.Write(result_data)
}
}
With our Go SDK you can
- Add PDF document’s header & footer in text or image format.
- Add tables & text or image stamps to PDF documents.
- Append multiple PDF documents to an existing file.
- Work with PDF attachments, annotations, & form fields.
- Apply encryption or decryption to PDF documents & set a password.
- Delete all stamps & tables from a page or entire PDF document.
- Delete a specific stamp or table from the PDF document by its ID.
- Replace single or multiple instances of text on a PDF page or from the entire document.
- Extensive support for converting PDF documents to various other file formats.
- Extract various elements of PDF files & make PDF documents optimized.
- You can try out our free App to test the functionality.
- Learning Resources
- Documentation
- Source Code
- API References
- Product Support
- Free Support
- Paid Support
- Blog
- Why Aspose.PDF Cloud for Go?
- Customers List
- Security