For the complete documentation index, see llms.txt. This page is also available as Markdown.

Existing Go (C Interface Binding) project with Apryse SDK PDF library integration

This guide will help you integrate a free trial of the Apryse SDK with Go using Apryse Headers on macOS, Linux or Windows in an existing Go app to create a new PDFDoc. (Or see instructions for creating a new Go app.)

Prerequisites

Make sure Go is installed at /usr/local/go and /usr/local/go/bin.

  • Apryse SDK for macOS

spinner

Make sure Go is installed at `/usr/local/go` and `/usr/local/go/bin`.

  • Apryse SDK for Linux

spinner
spinner

Make sure Go is part of your path variable.

  • Apryse SDK for Windows

spinner
spinner
  • Get your Apryse trial key.

spinner

License Key Required

The trial of Apryse SDK requires a trial license key, which is provided in the box titled "License Key". A commercial license key is required for use in a production environment. Please contact sales to purchase a commercial key or if you need any other license key assistance.

Integrate Apryse SDK with Go

Start by adding these lines to the beginning of your .go file:

Before calling other Apryse API, you must initialize PDFNet. The PDFNet initialize header is found in C/PDF/TRN_PDFNet.h and the PDFDoc header is found in C/PDF/TRN_PDFDoc.h. Include both at the beginning of your .go file:

Also import the unsafe library:

Then initialize PDFNet by calling these lines:

To create a new PDFDoc in Go, you must allocate memory for it and handle freeing the memory associated with it.

You can follow these steps to instantiate a PDFDoc:

To deallocate the memory used by the PDFDoc, you can use C.free:

Next step

GuidesAPI docsSamples

Last updated

Was this helpful?