Aspose.PDF FOSS for Go is a pure-Go library that enables developers to create, read, edit, merge,
split, and secure PDF documents without any external native dependencies. Built for server-side
Go applications, it integrates into any Go module project with a single
go get github.com/aspose-pdf-foss/aspose-pdf-foss-for-go command.
The library exposes a comprehensive API surface through the Document, Page, Form, Table,
and AnnotationCollection types, covering document management, AcroForm filling, structured table
layout, bookmark navigation, image handling, and PDF/A-level validation. Security features include
AES-128, AES-256, and RC4-128 encryption via EncryptionOptions and Permissions, with
granular per-operation access control. Aspose.PDF FOSS for Go is released under the MIT license with no runtime fees or usage restrictions. Requires Go 1.24 or later. For the enterprise product family, see the Aspose.PDF — Enterprise Product Family.
DocumentDocument instancesAppendPageRange for partial exportsMetadataEncryptionOptionsSetEncryption callPermissionsOpenWithPasswordForm and FieldTextBoxField instances by field nameCheckboxField and select RadioButtonField optionsComboBoxField and ListBoxField controlsButtonField actions in interactive form documentsTable, Row, and Cell typesBorderInfo per cell or tableMarginInfoTextStyle, Font, Color, HAlign, and VAlignImageOutlineItemCollectionDestinationXYZDestinationFitNamedDestinationsAnnotation and AnnotationCollectionTextAnnotation and FreeTextAnnotationStampAnnotation and StampNameHighlightAnnotationRedactAnnotationLinkAnnotationOpen a PDF, split it into per-page documents, or merge multiple files into one.
doc, _ := pdf.Open("input.pdf")
pages, _ := doc.Split()
for i, p := range pages {
p.Save(fmt.Sprintf("page%03d.pdf", i+1))
}
doc2, _ := pdf.Open("file2.pdf")
doc.Append(doc2)
doc.Save("merged.pdf")
Apply AES-128 encryption with granular print and copy permissions in one call.
doc, _ := pdf.Open("input.pdf")
doc.SetEncryption(pdf.EncryptionOptions{
UserPassword: "userpass",
OwnerPassword: "ownerpass",
Permissions: &pdf.Permissions{AllowPrint: true, AllowCopy: true},
})
doc.Save("restricted.pdf")
Target form fields by name and set values for all widget types.
doc, _ := pdf.Open("template.pdf")
text := doc.Form().Field("name").(*pdf.TextBoxField)
text.SetValue("Jane Doe")
check := doc.Form().Field("subscribe").(*pdf.CheckboxField)
check.SetChecked(true)
radio := doc.Form().Field("plan").(*pdf.RadioButtonField)
radio.Options()[1].SetSelected(true)
doc.Save("filled.pdf")
Build a nested bookmark tree with styled entries and precise page destinations.
doc, _ := pdf.Open("input.pdf")
page, _ := doc.Page(1)
chapter := pdf.NewOutlineItemCollection(doc)
chapter.SetTitle("Chapter 1")
chapter.SetBold(true)
chapter.SetDestination(pdf.NewDestinationXYZ(page, 0, 800, 1.0))
doc.Outlines().Add(chapter)
doc.Save("with_bookmarks.pdf")
Aspose.PDF FOSS for Go is released under the MIT License. The full license text is included in the repository at github.com/aspose-pdf-foss/aspose-pdf-foss-for-go.
Yes. The MIT license permits unrestricted commercial use, modification, distribution, and private use.
Aspose.PDF FOSS is the open-source, MIT-licensed edition. A separate commercial Aspose.PDF product is available at products.aspose.com/pdf/ with enterprise support, extended format coverage, and cloud integration.
Add the module to your Go project: bash go get github.com/aspose-pdf-foss/aspose-pdf-foss-for-go Import it with an alias in your source files: go import pdf 'github.com/aspose-pdf-foss/aspose-pdf-foss-for-go'
Go 1.24 or later is required. Verify your version with go version.