pdftron-go
pdftron-go copied to clipboard
PDFTron GoLang
Supported platforms: Linux , Mac, Windows
Environments and versions:
- Go 1.15 or greater
- Git
Run PDFTron Go SDK in production
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.
Running PDFTron Go in your project
-
Import
github.com/pdftron/pdftron-go/v2into 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/LibYou 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
Running PDFTron Go samples
- 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
./samplesdirectory and modify therunall_go.sh(runall_go.baton Windows) and set yourLICENSE_KEYand if using modules such as CAD,MODULE_PATHto the directory where your modules are stored. -
Run the
runallgo.sh(runall_go.baton 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 AddImageTestOutput files will be created in `TestFiles/Output``
Running a specific version of PDFTron Go
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)
Project Structure
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