npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datafire/api2pdf

v3.0.0

Published

DataFire integration for Api2Pdf - PDF Generation, Powered by AWS Lambda

Downloads

15

Readme

@datafire/api2pdf

Client library for Api2Pdf - PDF Generation, Powered by AWS Lambda

Installation and Usage

npm install --save @datafire/api2pdf
let api2pdf = require('@datafire/api2pdf').create({
  HeaderApiKey: "",
  QueryApiKey: ""
});

.then(data => {
  console.log(data);
});

Description

Introduction

Api2Pdf is a powerful PDF generation API with no rate limits or file size constraints. Api2Pdf runs on AWS Lambda, a serverless architecture powered by Amazon to scale to millions of requests while being up to 90% cheaper than alternatives. Supports wkhtmltopdf, Headless Chrome, LibreOffice, and PDF Merge. You can also generate barcodes with ZXING (Zebra Crossing).

SDKs & Client Libraries

We've made a number of open source libraries available for the API

Authorization

Create an account at portal.api2pdf.com to get an API key.

Authorize your API calls

  • GET requests, include apikey=YOUR-API-KEY as a query string parameter
  • POST requests, add Authorization to your header. Authorization: YOUR-API-KEY

Quickstart

If you are looking for just a quick call to grab PDFs of a URL, you can do a GET request like: https://v2018.api2pdf.com/chrome/url?url={UrlToConvert}&apikey={YourApiKey}

For more advanced usage and settings, see the API specification below.

Actions

chromeFromHtmlPost

Convert HTML to a PDF using Headless Chrome on AWS Lambda.

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.chromeFromHtmlPost({}, context)

Input

Output

chromeFromUrlGET

Convert a URL or Web Page to PDF using Headless Chrome on AWS Lambda. This GET request is for convenience and does not support advanced options. Use the POST request for more flexibility.

Authorize via Query String Parameter

apikey=YOUR-API-KEY

Example

https://v2018.api2pdf.com/chrome/url?url={UrlToConvert}&apikey={YourApiKey}

api2pdf.chromeFromUrlGET({
  "url": ""
}, context)

Input

  • input object
    • url required string: Url of the page to convert to PDF. Must start with http:// or https://.
    • output string: Specify output=json to receive a JSON output. Defaults to PDF file.

Output

chromeFromUrlPost

Convert a URL or Web Page to PDF using Headless Chrome on AWS Lambda..

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.chromeFromUrlPost({}, context)

Input

Output

libreConvertPost

Convert an office document (Word, Excel, Powerpoint) or an image (jpg, gif, png) to a PDF using LibreOffice on AWS Lambda.

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.libreConvertPost({}, context)

Input

Output

mergePost

Merge two or more PDFs together on AWS Lambda.

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.mergePost({}, context)

Input

Output

wkhtmltopdfFromHtmlPost

Convert HTML to a PDF using WkHtmlToPdf on AWS Lambda.

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.wkhtmltopdfFromHtmlPost({}, context)

Input

Output

wkhtmltopdfFromUrlGET

Convert a URL or Web Page to PDF using WkHtmlToPdf on AWS Lambda. This GET request is for convenience and does not support advanced options. Use the POST request for more flexibility.

Authorize via Query String Parameter

apikey=YOUR-API-KEY

Example

https://v2018.api2pdf.com/wkhtmltopdf/url?url={UrlToConvert}&apikey={YourApiKey}

api2pdf.wkhtmltopdfFromUrlGET({
  "url": ""
}, context)

Input

  • input object
    • url required string: Url of the page to convert to PDF. Must start with http:// or https://.
    • output string: Specify output=json to receive a JSON output. Defaults to PDF file.

Output

wkhtmltopdfFromUrlPost

Convert a URL or Web Page to PDF using WkHtmlToPdf on AWS Lambda..

Authorize via Header of Request

Authorization: YOUR-API-KEY

api2pdf.wkhtmltopdfFromUrlPost({}, context)

Input

Output

zebraGET

See full list of options and documentation here

Authorize via Query String Parameter

apikey=YOUR-API-KEY

Example

https://v2018.api2pdf.com/zebra?format={format}&apikey={YourApiKey}&value={YourText}

api2pdf.zebraGET({
  "format": "",
  "value": ""
}, context)

Input

  • input object
    • format required string: Most common is CODE_39 or QR_CODE
    • value required string: Specify the text value you want to convert
    • showlabel boolean: Show label of text below barcode
    • height integer: Height of the barcode generated image
    • width integer: Width of the barcode generated image

Output

  • output string

Definitions

ApiResponseFailure

  • ApiResponseFailure object
    • reason string: The reason for the PDF generation failure
    • success boolean: Will be false if the operation failed

ApiResponseSuccess

  • ApiResponseSuccess object
    • cost number: Cost of the operation (mbIn + mbOut) * $.001
    • mbIn number: The amount of megabytes of bandwidth used to process the pdf
    • mbOut number: The amount of megabytes of bandwidth generated from the resulting pdf
    • pdf string: A url to the PDF that will exist only for 24 hours
    • success boolean: Will be true if the operation suceeded

ChromeAdvancedOptions

  • ChromeAdvancedOptions object
    • landscape string
    • printBackground boolean

ChromeHtmlToPdfRequest

  • ChromeHtmlToPdfRequest object

ChromeUrlToPdfRequest

  • ChromeUrlToPdfRequest object

LibreOfficeConvertRequest

  • LibreOfficeConvertRequest object
    • fileName string
    • inlinePdf boolean
    • url required string

MergeRequest

  • MergeRequest object
    • fileName string
    • inlinePdf boolean
    • urls required array
      • items string

WkHtmlToPdfAdvancedOptions

  • WkHtmlToPdfAdvancedOptions object
    • orientation string
    • pageSize string

WkHtmlToPdfHtmlToPdfRequest

WkHtmlToPdfUrlToPdfRequest