PDF Generator API

Generate PDF documents from HTML documents using our PDF generation API. Simply use HTML and CSS to describe how the document should look, and call our API to generate your PDF.

Try It Out

This example will create a PDF from the supplied index.html file and render it on an A4-sized page. For detailed information on how to structure your HTML files, along with all the available customization options, see here.

1

Use Your Free Credits

Sign up to get 100 free credits, or log in to automatically add your API key to sample code.

Add a File

Add an HTML file named index.html to your project folder. You can also use our sample file.

Run a Command

Copy the curl command and run it in that same folder via the terminal or your editor’s terminal.

View the Results

Open result.pdf in your project folder to view the results.

Shell
    curl -X POST https://api.pspdfkit.com/build \
        -H "Authorization: Bearer your_api_key_here" \
        -o result.pdf \
        -F index.html=@index.html \
        -F instructions='{
            "parts": [
              { "html": "index.html" }
            ]
          }'
Using Postman? Download our official collection and start using the API with a single click. Read more 

Your API Key

Get access to your API key when you create an account. Once your account has been created, you’ll receive 100 free credits for using with any of our API tools.

Your API key has automatically been inserted into the API example code. Run the sample code in your terminal to execute the API call.

Already Have an Account? Sign In →