Environments and versions:
- Minimum RAM of 2GB in Linux or 4GB in Mac/Windows
- Go 1.15
Note: Ubuntu Linux 14.0.x can only use Go 1.15.
- Git
For Windows, you will need mingw-64:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/
Click on MinGW-W64-install.exe under MinGW-W64 Online Installer and make sure to choose x86_64 architecture during installation.
If you need GO111MODULE enabled, please see the notes at the end of this page.
Run PDFTron Go SDK in production
A commercial license key is required for use in a production environment. Please fill out our licensing form if you do not have a valid license key.
Running PDFTronGo from Linux
Run RunSampleLinux.sh from $HOME or
- cd $HOME
- export GO111MODULE=off
- go get github.com/PDFTron/pdftron-go
- cp -r go/src/github.com/PDFTron/pdftron-go/src_linux/pdftron/ go/src/
- cp -r go/src/github.com/PDFTron/pdftron-go/Samples/ go/src/pdftron/
To execute the sample code, you can try the following:
- cd $HOME/go/src/pdftron/Samples/AddImageTest/GO
- ./RunTest.sh
Running PDFTronGo from Mac
Run RunSampleMac.sh from $HOME or
- cd $HOME
- export GO111MODULE=off
- go get github.com/PDFTron/pdftron-go
- cp -R go/src/github.com/PDFTron/pdftron-go/src_mac/pdftron/ go/src/pdftron/
- cp -R go/src/github.com/PDFTron/pdftron-go/Samples/ go/src/pdftron/Samples/
- install_name_tool -id "@rpath/libpdftron.dylib" $HOME/go/src/pdftron/PDFNetC/Lib/libpdftron.dylib
To execute the sample code, you can try the following:
- cd $HOME/go/src/pdftron/Samples/AddImageTest/GO
- ./RunTest.sh
Running PDFTronGo from Windows
Run RunSampleWindows.bat from %HOMEPATH% or
- Run mingw-w64.bat from "C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0" to open command prompt
- cd %HOMEPATH%
- set GO111MODULE=off
- go get github.com/PDFTron/pdftron-go
- xcopy /E /I go\src\github.com\PDFTron\pdftron-go\src_win go\src
- xcopy /E /I go\src\github.com\PDFTron\pdftron-go\Samples go\src\pdftron\Samples
To execute the sample code, you can try the following:
- cd %HOMEPATH%\go\src\pdftron\Samples\AddImageTest\GO
- RunTest.bat
Output file will be in $HOME/go/src/pdftron/Samples/TestFiles/Output
Bin file will be in $HOME/go/src/pdftron/Samples/bin
Running PDFTronGo with GO111MODULE enabled
- cd $HOME
- export GO111MODULE=off
- go get github.com/PDFTron/pdftron-go
- export GO111MODULE=on
- cp -R go/src/github.com/PDFTron/pdftron-go/src_linux/pdftron/ go/src/pdftron/
- cp -R go/src/github.com/PDFTron/pdftron-go/Samples/ go/src/pdftron/Samples/
- cd $HOME/go/src/pdftron/Samples/AddImageTest/GO
- Modify AddImageTest.go to the following and save.
package main
import (
"fmt"
. "github.com/PDFTron/pdftron-go/src_linux/pdftron"
)
func main(){
PDFNetInitialize("pleaseinsertlicensekeyhere")
- ./RunTest.sh