PDFTeam - The PDF API


The PDFTeam API provides a range of easy to use and fast API endpoints for all things PDF:

▶ Convert TXT, MARKDOWN / MD, HTML and many other formats to and from PDF

▶ Add watermarks (images, logos, text, page numbers) to any PDF

▶ Add barcodes and QR codes to any PDF; our API supports all common linear and 2D barcodes

Our API is hosted on high-performance AMD servers in the EU and North America with a typical conversion time of less than two seconds for a medium sized PDF. Endpoints either return the resulting document directly in base64 format or as a permalink to AWS S3.

Use of the API is credits based and follows a simple rule: Any conversion, modification or creation of a PDF costs one credit. Please see the pricing page for details.

Here's an example of an invoice in HTML format (source):

HTML Invoice

Converting the invoice to a PDF yields the following; we also added a logo (top right), a text overlay ("PAST DUE", center, rotated) and a QR code (bottom left):

PDF Invoice with QR, watermark, logo converted from HTML

This was done with a single call to the html2pdf endpoint (snippet below shows NodeJS sample code with fetch).

The code sets the API credentials first and then specifies options for the input, the output and the actual PDF. With the settings below, the API will create a letter-sized PDF from the HTML invoice and then write it to an S3 bucket with the given file name. The permalink to the PDF will then be returned to the user.

The overlays-section provides defintions for three types of overlays: a barcode (type: 19 indicates the QR code type), a text and finally an image:

const url = 'https://api.pdfteam.com/api/html/2/pdf';

let params = {
  job: '00012345',
  user: 'YOUR_USERNAME',
  key: 'YOUR_APIKEY',
  inputOptions: {
    source: 'https://pdfteam.com/samples/invoice.html',
  },
  outputOptions: {
    storage: true,
    file: 'converted_invoice.pdf',
  },
  pdfOptions: {
    format: 'Letter',
  },
  overlays: [
    {
      position: {
        x: 'left',
        y: '30mm',
      },
      type: 'barcode',
      config: {
        type: 19,
        data: 'https://pdfteam.com',
      },
    },
    {
      rotate: 45,
      position: {
        x: 'center',
        y: 'middle',
      },
      type: 'text',
      config: {
        data: 'PAST DUE',
        font: 'Helvetica Bold',
        size: 72,
        color: '#ff0000',
        opacity: 0.5,
      },
    },
    {
      position: {
        x: '132mm',
        y: '228mm',
      },
      type: 'image',
      config: {
        source: 'https://pdfteam.com/samples/acme_logo.png',
      },
    },
  ],
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(params),
}).then((result) => {
  result.text().then((text) => {
    console.log(text);
  });
});



NOTE 1: The PDFTeam APIs are intended for conversion of documents like receipts, invoices, reports, contracts, quotes, waybills, letters and so forth. They are not suitable for scraping or similar applications

NOTE 2: This site is still under construction and the API docs haven't been finalized yet. Please check back in a few days. If you have concrete requirements, please contact us