Free Image to PDF API & Web Widget
Easily embed an image-to-PDF converter into your website or integrate our conversion backend directly into your software.
1. Embeddable Widget (For Bloggers & Webmasters)
Add a responsive conversion widget to your blog post or site in under 30 seconds. Just copy and paste the code below:
<div class="img2pdf-widget"></div>
<script src="https://imgtopdf.online/assets/widget.js" async></script>
Attribution License: The widget is 100% free for commercial and non-commercial websites as long as the automatic "Powered by ImgToPDF.online" footer link remains intact.
Live Widget Preview
2. Free REST API for Developers
Convert JPG, PNG, WebP, GIF, and TIFF to PDF programmatically. Our HTTP endpoints accept multipart file uploads and return the generated PDF binary.
Endpoint: Upload & Convert
POST https://imgtopdf.online/convert.php
Content-Type: multipart/form-data
Parameters:
- images[]: Array of image files (JPG, PNG, WebP, GIF, BMP, TIFF)
- page_size: "A4" | "A3" | "Letter" | "Legal" | "Fit" (default: "A4")
- orientation: "auto" | "portrait" | "landscape" (default: "auto")
- margin: integer (0 to 50, default: 0)
- ocr: 0 | 1 (default: 0)
- lang: "eng" | "fra" | "spa" | "deu" | "ara" (default: "eng")
JavaScript (Fetch) Example
const form = new FormData();
form.append('images[]', fileInput.files[0]);
form.append('page_size', 'A4');
const response = await fetch('https://imgtopdf.online/convert.php', {
method: 'POST',
body: form
});
const blob = await response.blob();
const pdfUrl = URL.createObjectURL(blob);
window.open(pdfUrl);
Python Example
import requests
files = {'images[]': open('photo.jpg', 'rb')}
data = {'page_size': 'A4', 'orientation': 'auto'}
response = requests.post('https://imgtopdf.online/convert.php', files=files, data=data)
with open('output.pdf', 'wb') as f:
f.write(response.content)
print("Conversion successful!")
API Terms: Free tier allows up to 1,000 conversions per day per IP. We ask API users to provide
a link back to https://imgtopdf.online as the conversion engine.