PDF.js Express Plusplay_arrow

Professional PDF.js Viewing & Annotations - Try for free

side menu

Get Started

play_arrow

Learn more

play_arrow

Common use cases

play_arrow

Open a document

play_arrow

Save a document

play_arrow

Viewer

play_arrow

UI Customization

play_arrow

Annotations

play_arrow

Collaboration

play_arrow

Forms

play_arrow

Signature

play_arrow

Searching

play_arrow

Measurement

play_arrow

Compare

play_arrow

Advanced Capabilities

play_arrow

PDF.js Express REST API

play_arrow

Migration Guides

play_arrow

Server side usage

The following features are available in:

check

PDF.js Express Viewer

help_outline

PDF.js Express Viewer is a free viewer with limited capabilities compared to PDF.js Express Plus

check

PDF.js Express Plus

help_outline

PDF.js Express Plus is a commercial PDF SDK for viewing, annotating, signing, form filling and more

If you need to use our rest API from the server, we recommend using the Rest API Utility package as it handles many edge cases when dealing with files in node.

When using the utility package in node, the API is the exact same, however you must pass a ReadStream instead of a Blob.

Example:

const Utils = require('@pdftron/pdfjs-express-utils').default;
const fs = require('fs');

const u = new Utils({
  serverKey: 'YOUR_KEY_HERE'
});

(async () => {
  const readStream = fs.createReadStream('myPDF.pdf');

  const xfdf = `<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><pdf-info xmlns="http://www.pdftron.com/pdfinfo" version="2" import-version="3" /><fields /><annots><square page="0" rect="414.95599999999996,1393.51,635.3059999999999,1546.05" color="#000000" flags="print" name="5616161f-3466-9898-dfea-228357f8c855" title="Guest" subject="Rectangle" date="D:20210713134128-07'00'" width="9.437031125299281" creationdate="D:20210713134127-07'00'"/></annots><pages><defmtx matrix="1,0,0,-1,-309.27599999999995,1630.8" /></pages></xfdf>`
  
  u.setFile(readStream)
    .setXFDF(xfdf);
  
  const response = await u.merge(); // merge XFDF

  const mergedFile = await response.getBlob();
  await response.deleteFile();

  fs.writeFileSync('out.pdf', mergedFile)
})()