In this tutorial, we will show you how to select random pages of Excel to make a PDF using PDF.co Web API.
We will use this sample Excel document with 3 worksheets in this tutorial.
Step 1: Log in to PDF.co Account
- To begin. First, log into your PDF.co account and click on the Request Tester menu.
Step 2: Request Tester Page
- Once you’re on the Request Tester page, select
/xls/convert/to/pdfthe Choose PDF.co API endpoint field. This endpoint will convert the Excel file to PDF.
- For the Input parameters field, add your source file with a link or input with a file.
- Then, enter the sample JSON code. The worksheet index parameter will allow you to specify which specific sheets you want to convert to PDF. The worksheet index starts at
“0”sheet 1 and the worksheet index
“1”represents sheet 2.
Once you are done setting up, click on the Run Request button to see the result.
Step 3: Run Request Result
- Great! The PDF.co successfully process our request. You can copy and paste the URL to view the output.
Step 4: Generated PDF Output
- Here’s the generated PDF output from selected Excel pages or worksheets.
In this tutorial, you learned how to select random pages of 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.
This is just one of the examples of the PDF.co Web API’s functionality. You can do a lot more, such as generating PDFs using Airtable linked records, merging or splitting PDF files, and many others.