Generate your first PDF.
Try a sample in your browser, run the PDF API locally, or deploy it to Vercel.
Choose how to run PressJet
Start the published Beta 7 API. You need Docker, OpenSSL and curl.
export PRESSJET_API_KEY="$(openssl rand -hex 32)" docker run --rm --detach --name pressjet-quickstart \ --publish 127.0.0.1:8080:8080 \ --env PRESSJET_API_KEY \ ghcr.io/tonysantana1492/pressjet:0.1.0-beta.7
Download the Beta 7 executable for Linux x86-64 or ARM64. You need the GitHub CLI, OpenSSL and curl. Run the next steps in the same terminal.
tag=v0.1.0-beta.7 name="pressjet-$tag-$(uname -m)-unknown-linux-musl" gh release download "$tag" -R tonysantana1492/pressjet \ -p "$name.tar.gz" -p "$name.tar.gz.sha256" sha256sum -c "$name.tar.gz.sha256" tar xzf "$name.tar.gz" export PRESSJET_API_KEY="$(openssl rand -hex 32)" PRESSJET_HOST=127.0.0.1 "./$name/pressjet" serve & pressjet_pid=$!
Open the Playground, select Render and then Download PDF. The engine runs on your device.
Check the API
curl --fail-with-body http://127.0.0.1:8080/health
Continue when the response includes "status":"ok".
Render the sample invoice
Save the request and run this command from the same folder and terminal.
curl --fail-with-body http://127.0.0.1:8080/v1/html \ -H "Authorization: Bearer $PRESSJET_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @invoice-request.json \ --output invoice.pdf
Open invoice.pdf. It should contain one A4 page with an invoice title, line item and total.
Stop the test when you finish. For Docker, run docker stop pressjet-quickstart. For the binary, run kill "$pressjet_pid" in the same terminal.
Connect your app
release=https://github.com/tonysantana1492/pressjet/releases/download/v0.1.0-beta.7 arch=$(node -p 'process.arch') npm install "$release/pressjet-0.1.0-beta.7.tgz" "$release/pressjet-linux-$arch-0.1.0-beta.7.tgz"
release=https://github.com/tonysantana1492/pressjet/releases/download/v0.1.0-beta.7 arch=$(uname -m) python -m pip install "$release/pressjet-0.1.0b7-py3-none-manylinux_2_17_$arch.musllinux_1_2_$arch.whl"
go get github.com/tonysantana1492/pressjet/sdks/go@v0.1.0-beta.7
gh release download v0.1.0-beta.7 -R tonysantana1492/pressjet -p pressjet-php-v0.1.0-beta.7.zip
mkdir -p packages/pressjet
unzip -q pressjet-php-v0.1.0-beta.7.zip -d packages/pressjet
composer config repositories.pressjet '{"type":"path","url":"packages/pressjet","options":{"versions":{"pressjet/pressjet":"0.1.0-beta.7"}}}'
composer require pressjet/pressjet:0.1.0-beta.7
gh release download v0.1.0-beta.7 -R tonysantana1492/pressjet \ -p pressjet-wasm-0.1.0-beta.7.tgz -p pressjet-wasm-0.1.0-beta.7.tgz.sha256 sha256sum -c pressjet-wasm-0.1.0-beta.7.tgz.sha256 npm install ./pressjet-wasm-0.1.0-beta.7.tgz