Convert the first page of a PDF to an image

Upload your PDF file via the "UPLOAD" button or API and get a link for your the image of the first page of the pdf.

Free API solutions

We offer free innovative solutions to businesses and libraries who are working with PDF files and helping them to achieve their goals faster. We offer APIs to convert PDF files to image.

Convert with javascript

Our website offers a simple and efficient way to convert the first page of a PDF to an image. You can use our API or upload your file in the header of this website, to quickly and easily convert your PDFs, allowing you to work more efficiently and save time.

create a post request to:
https://cover-image.com/api/pdf-to-image

{
       "callbackUrl": "https://you_example_website_url.com/api/update-pdf",
       "id": "51234",
       "pdf": "JVBERjMgMCBvDwgDS9MaW5lY... "
}

"callbackUrl" is The in your website for reciving the response
after the process get finished.

"id" is your unique id, it will be return in the response
"pdf" is the pdf base64 encode


Javascript code example:

const toBase64 = file => new Promise((resolve, reject) => {
       const reader = new FileReader();
       reader.readAsDataURL(file);
       reader.onload = () => resolve(reader.result);
       reader.onerror = error => reject(error);
});

async function Main(e) {
       const file = document.querySelector('#upload-btn').files[0];
       const base64Pdf = await toBase64(file);
       fetch("https://cover-image.com" + '/api/pdf-to-image', {
             headers: {
                   'Content-Type': 'application/json'
             },
             method: 'post',
             body: JSON.stringify({
                   "pdf" : base64Pdf.substring(28)
             })
       }).then(res => {
             return res.json();
       }).then(data => {
             console.log('data', data)
             const uploadLink = document.getElementById('upload-link');//           
             uploadLink.href = data.imageUrl;
             uploadLink.innerHTML = data.imageUrl;
       });
}