PDF Creator API

Create PDF documents from HTML documents using our PDF creation API. Simply use HTML and CSS to describe how the document should look, and call our API to create 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.


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. The file name is case sensitive. Make sure the file name matches the file name in the sample code.

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.

    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