Convert a Selected Excel Worksheet to PDF Using PDF.co
You can use PDF.co’s API Tester to convert a specific worksheet from an Excel workbook into a PDF. Let’s go through the steps:
Step 1: Open the Excel to PDF API Tester
Sign in to your PDF.co account, then open the Excel to PDF API Tester.
This operation uses:
POST https://api.pdf.co/v1/xls/convert/to/pdf
Click Try it to configure the request. If authorization is requested, provide your PDF.co API key in x-api-key.
Step 2: Provide Your Excel File
In url, enter a direct download URL for your XLS or XLSX workbook.
If the file is on your computer, upload it to PDF.co Files first and use the resulting file link.
Step 3: Select the Worksheet
Configure these request fields:
- worksheetindex: Enter
"2"to convert the second worksheet. Worksheet numbering starts at1. - name: Enter
selected-worksheet.pdf. - async: Set to
falsefor this small-file example. - autosize: Set to
falseto use the worksheet’s existing page setup.
For example:
{
"url": "YOUR_EXCEL_FILE_URL",
"worksheetindex": "2",
"name": "selected-worksheet.pdf",
"async": false,
"autosize": false
}Replace YOUR_EXCEL_FILE_URL with your workbook’s file link. See the Excel to PDF documentation for available parameters.
Step 4: Run and Download
Submit the request and review the response.
Open the returned url to view the PDF. Confirm that it contains the intended worksheet, then download it before the temporary link expires.
In this tutorial, you learned how to convert an Excel to make a PDF using PDF.co Web API. You also learned how to use the /v1/xls/convert/to/pdf endpoint to convert XLS to PDF format.
Related Tutorials

