Some test text!
Go / Guides / Step by step
Platform
Documentation
Welcome to Apryse. Go for the Apryse SDK is supported on Windows and Linux. To get started, choose your preferred platform from the tabs below.
This guide will help you run Apryse samples and integrate the Apryse SDK into Go applications on Windows. Your free trial includes unlimited trial usage and support from solution engineers.
# Download the batch file or use curl from the command line
curl https://raw.githubusercontent.com/PDFTron/pdftron-go/main/RunSampleWindows.bat -o RunSampleWindows.bat
# Double-click RunSampleWindows.bat or run the batch file from the command line
start RunSampleWindows.bat
If your OS or Go version is not supported, the installation will fail.
samples
foldercd %HOMEPATH%\go\src\pdftron\Samples\
runall_go.bat
You can also enter any individual sample folder to run them separately. For example, here's how to run the AddImageTest
sample:
cd %HOMEPATH%\go\src\pdftron\Samples\AddImageTest\GO
RunTest.bat
This section will show you how to use our SDK to create a simple Apryse "Hello World!" application. It will create a document with one blank page and save it as a linearized PDF in its running directory.
Navigate into your /Samples
directory and make a new directory called myApp
(if it does not exist already). This guide will assume your application is named myApp. For organization, create a new directory inside myApp
called GO
.
Navigate inside that GO
directory and create a new GO file called myApp.go
. Open it with your favorite text editor and paste this into it:
package main
import (
"fmt"
. "pdftron"
)
func main(){
PDFNetInitialize() // PDFNet must be initialized before accessing any Apryse API
doc := NewPDFDoc()
page := doc.PageCreate() // Start a new page
doc.PagePushBack(page) // Add the page to document
doc.Save("output.pdf", uint(SDFDocE_linearized)); // Save the document as a linearized PDF
doc.Close()
}
Run your application by executing go run myApp.go
. Make sure that your interpreter can find the PDFNetC library. If all goes well, your console should output:
PDFNet is running in demo mode.
Permission: write
Hello World!
Check the output.pdf
that the program output in the same directory. It should be a PDF with one blank page.
Get the answers you need: Support