We continue to enhance our V2 API which is loaded with features now. Check out our REST API documentation here.
A major annoyance for developers is having to generate a thumbnail or image preview of an uploaded Office file or PDF file. We have now added a new endpoint located at /libreoffice/thumbnail that will ingest a URL to your PDF or Office file. Behind the scenes, we actually use LibreOffice to first convert the file to PDF format (even if it’s already a PDF, that’s okay). We then use another LibreOffice command to pull the 1st page of the resulting PDF and convert that to a JPG file. Unfortunately there is no support to convert the entire file to an image at this time. But that’s fine. For most thumbnail use cases, you are just interested in showing the first page anyway.
In short, to convert PDF to JPG or Office File to JPG (first page only), you will want to make a simple POST call to our api (grab your API key) with the following details:
Type: POST
Endpoint: https://v2.api2pdf.com/libreoffice/thumbnail
Header:
Authorization: YOUR-API-KEY
content-type: appliation/json
JSON Payload:
{ “url”: “https://www.api2pdf.com/wp-content/themes/api2pdf/assets/samples/sample-power-point.pptx” }
That’s it. Don’t forget to replace the url in the payload with the actual url to your asset you need to convert.
Tags: .net core office file thumbnail, .net core office file to image, .net core pdf thumbnail, .net core pdf to image, .net core word file thumbnail, c# pdf to image, first page of pdf to image, merge pdfs .net core, nodejs convert pdf to image, nodejs office to image file preview, nodejs pptx thumbnail, office file to image preview api, pdf to image preview api, php office file to image first page, php pdf to image first page, pptx to jpg, python docx to image, python pdf to image preview, python pptx to image, python thumbnail office file, python thumbnail pdf, thumbnail pdf apiComments are closed.