Get an AcroForms from PDF document via Cloud Go SDK
In order to get an AcroForms from PDF, we’ll use Aspose.PDF Cloud Go SDK. This Cloud SDK assists Go programmers in developing cloud-based PDF creator, annotator, editor, and converter apps using Go programming language via Aspose.PDF REST API. Simply create an account at Aspose for Cloud and get your application information. Once you have the App SID & key, you are ready to give the Aspose.PDF Cloud Go SDK.
Package Manager Console Command
go get -u github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25
Steps to get AcroForms via Go
Aspose.PDF Cloud developers can easily load & get acroforms from PDF in just a few lines of code.
- Upload the PDF file to the Aspose.PDF Cloud service.
- Log any errors that occur during the file upload.
- Retrieve the form fields from the PDF file in the Aspose.PDF Cloud storage.
- Iterate through the form fields and log the field names and values to the console.
- Log any errors that occur during the field retrieval
- Download the result if needed it
This sample code shows getting an AcroForms from PDF documents using Go
package main
import (
"fmt"
asposepdfcloud "github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25"
)
func appendFormFiled(document_name string, output_name string, local_folder string, remote_folder string) {
// Initialize Credentials and create Pdf.Cloud service object
AppSID := "YOUR_APP_SID" // Your Application SID
AppKey := "YOUR_APP_KEY" // Your Application Key
pdfApi := asposepdfcloud.NewPdfApiService(AppSID, AppKey, "")
args := map[string]interface{}{
"folder": remote_folder,
}
file, _ := os.Open(filepath.Join(local_folder, document_name))
_, _, _ = pdfApi.UploadFile(filepath.Join(remote_folder, document_name), file, args)
result, httpResponse, err := pdfApi.GetFields(document_name, args)
if err != nil {
fmt.Println(err.Error())
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
fmt.Println("Unexpected error!")
} else {
for i, f := range result.Fields.List {
fmt.Println("field > ", i, ": type: '"+string(f.Type_)+"', name: '"+f.Name+",' values: '"+f.Values[0]+"'")
}
}
}
Work with the AcroForms via Go SDK
Extracting AcroForm data allows you to compile and analyze information collected from users efficiently, such as surveys or application responses. Retrieved AcroForm data can be integrated into databases, spreadsheets, or other systems for further processing or record-keeping. Extracting AcroForms helps in auditing filled-out forms to verify the accuracy, authenticity, or completeness of the provided data. Retrieving AcroForms is essential when transferring forms to other document management systems or creating backups. Get the AcroForms from PDF documents with Aspose.PDF Cloud Go SDK.
With our Go library you can
- Add PDF document’s header & footer in text or image format.
- Add tables & stamps (text or image) 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 get the AcroForms from PDF files online and 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