Environments and versions:
- Go 1.15 or greater
- Git
A commercial license key is required for use in a production environment. Please contact us to purchase a commercial license if you do not have a valid license key.
-
Import
github.com/pdftron/pdftron-go/v2
into your project a. On Windows, you will have to locate the DLLs for running the project and append them to your path.set PATH=%GOPATH%/pkg/mod/github.com/pdftron/pdftron-go/v2@your_version/shared_libs/win/Lib
You may also copy these directly to your project directory.
-
Create a main.go in your project directory
package main
import (
. "github.com/pdftron/pdftron-go/v2"
)
func main() {
PDFNetInitialize("myLicenseKey:");
// do work
}
go build
&& run your created executable
- Navigate to your go path where you installed the library, and search for our repository. It may be within this path based on your version of Golang.
$GOPATH/pkg/mod/github.com/pdftron/pdtron-go@version
-
Navigate to the
./samples
directory and modify therunall_go.sh
(runall_go.bat
on Windows) and set yourLICENSE_KEY
and if using modules such as CAD,MODULE_PATH
to the directory where your modules are stored. -
Run the
runallgo.sh
(runall_go.bat
on Windows). All sample tests will be run. a. If you wish to run a specific test, this can be done by specifying the test./runall_go.sh AddImageTest
Output files will be created in `TestFiles/Output``
This can be done by modifying your go.mod via this command in your project directory.
go mod edit -require github.com/pdftron/pdftron-go/[email protected]`
go mod tidy (or go get github.com/pdftron/pdftron-go/v2)
The project is structured into the following
root - this repository
source code placed in root - this contains each of the system specific source files
shared_libs - this contains the Apryse SDK library files to run the go library
win
Lib
Resources
mac
Lib
Resources
mac_arm
Lib
Resources
linux
Lib
Resources