Resize PDF Files Online
Short answer
Add any image option to a PDF's URL to show it as an image, for example ?w=400 for a 400 px wide preview. Sirv shows the first page, or the page you choose with the page parameter. It serves the image as AVIF when the browser supports it, otherwise PNG, or in a format you set.
After reading this you will know
- How to show a PDF as an image on a web page
- How to pick the page and the image format
Display PDF files as images simply by applying any of Sirv’s image processing options. For example, show the PDF as a 400px width image by appending ?w=400 to the URL.
The first page will be displayed, or you can use the page parameter to specify which page should be shown. Try it in the demo below.
The PDF will be converted to an AVIF image if the users browser supports AVIF, otherwise a PNG will be served. Alternatively, you can specify which image format should be served.
