How to Install Aspose.PDF for Go via C++

Installation

This package includes a large file which is stored as a bzip2 archive.

  1. Add the asposepdf package to Your Project:
go get github.com/aspose-pdf/aspose-pdf-go-cpp@latest
  1. Generate the large file:
  • macOS and linux
  1. Open Terminal

  2. List the folders of the github.com/aspose-pdf within the Go module cache:

ls $(go env GOMODCACHE)/github.com/aspose-pdf/
  1. Change curent folder to the specific version folder of the package obtained in the previous step:
cd $(go env GOMODCACHE)/github.com/aspose-pdf/aspose-pdf-go-cpp@vx.x.x

Replace @vx.x.x with the actual package version.

  1. Run go generate with superuser privileges:
sudo go generate
  • Windows
  1. Open Command Prompt

  2. List the folders of the github.com/aspose-pdf within the Go module cache:

for /f "delims=" %G in ('go env GOMODCACHE') do for /d %a in ("%G\github.com\aspose-pdf\*") do echo %~fa
  1. Change curent folder to the specific version folder of the package obtained in the previous step:
cd <specific version folder of the package>
  1. Run go generate:
go generate
  1. Add specific version folder of the package to the %PATH% environment variable:
setx PATH "%PATH%;<specific version folder of the package>\lib\"

Replace <specific version folder of the package> with the actual path obtained from step 2.

Testing

The test run from the root package folder:

go test -v

Quick Start

All code snippets are contained in the snippet.