The PDF Converter API converts any supported file formats into PDF. It can preserve the table structure of CSV and XLS as well as preserve the layout of HTML and DOCS to mention a few. This API has several endpoints for specific file formats with their own custom parameters and configurations. Kindly explore our supported file formats below:

CSV to PDF URL to PDF
HTML to PDF Email to PDF
XLS to PDF Image to PDF
DOC to PDF

The PDF.co platform keeps your data secure. We use SSL, TLS, and file encryption to protect your files and accounts. Please check out our Security page https://pdf.co/security to learn more.

PDF Converter API Benefits

Preserve Layout

The PDF Converter API preserves the layout of the original file when converted to PDF. Our engine uses an advanced configuration to maintain the structure of tables, rows, and columns as well as the text formatting of the file.

Large Files Support

The Web API supports large file conversion. It can process files that are over 100 MB in size using the parameter async:true. This feature runs the job in the background and returns a Job Id to check the job status.

Sign Up for Free

Web API Supports Multiple Languages

PDF.co platform can be used by software developers from programming languages such as PHP, Javascript, .NET and ASP.NET, C#, Java, Visual Basic, and many others. Find source code samples in our API documentation.

API and Business Automation Platforms

If you are not a developer, you can also easily automate your PDF operations via popular business automation platforms: ZapierMakeAirtableSalesforceGoogle Apps Script, and 300+ more.

PDF Converter API Samples & Demo

In this demonstration, we will use the DOC to PDF conversion /v1/pdf/convert/from/doc endpoint to showcase the PDF Converter Web API. We have a 1-page DOC that contains text and images. Once the request has been processed we will have the same document but in PDF format. Please see the side-by-side graphic of the input DOC and output PDF below.

PDF.co PDF Converter API Input File
Images of Input DOC and Output PDF

Before we start coding, let’s get to know the /v1/pdf/convert/from/doc endpoint’s parameters.

Endpoint

URL: https://api.pdf.co/v1/pdf/convert/from/doc
Method: POST
Parameter Description
url required. Link to the source file.
pages optional. Comma-separated list of page indexes or ranges to process.
encrypt optional. Enable encryption for the output file: true or false
async optional. Runs processing asynchronously. Returns jobId to use with job/check: true or false
name optional. Output file name.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

cURL Code Snippet

curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/doc' \
--header 'x-api-key: {{x-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/doc-to-pdf/sample.docx",
    "pages": "0-",
    "name": "result.pdf"
}'

This sample code and other cURL codes are available here.

Let’s see the PDF Converter Web API in action using the cURL code above.

PDF.co PDF Converter API Output
DOC to PDF Conversion Demo

The DOC to PDF JavaScript source code samples are available here.

The DOC to PDF PHP source code samples are available here.

The sample code for DOC to PDF in Python is here.

The DOC to PDF Java source code samples are available here.

The DOC to PDF C# source code samples are available here.

Sign Up