Convert JPG to PDF in the Browser with jsPDF
To convert a JPEG (or another local image/* file) to PDF in Docify, pick the file and click Generate PDF. Each image is read with FileReader.readAsDataURL, placed on its own A4 portrait page, scaled to fit inside the page minus 20 mm, and centered. addImage is always called with the JPEG format argument. The download is images.pdf. Nothing is uploaded.
Conversion is a button, not a live export. The Images to PDF tool does not password-protect the file, does not rotate the page to landscape, and does not claim print-shop quality. For page order and the Up / Down buttons, see how to combine several images. For what this page will not do, see images-to-PDF limits.
How Generate PDF places a JPEG
- Upload keeps files whose
typestarts withimage/and reads each one withFileReader.readAsDataURL. Preview is a normal<img>. - Generate constructs
new jsPDF()(A4 portrait, millimetre units). The first image uses the default page; later images calladdPage(). - Pixel size comes from an HTML
Imageload of that same data URL. The bitmap is scaled to fit inside the page minus 20 mm on the constraining axis, then centered. - Embed always calls
addImagewith format'JPEG'on the original data URL — including when the source file was a PNG. Download isimages.pdf. Errors surface withalert().
What this page does not do
- It does not encrypt or password-protect the PDF. The old “document security” bullet was not about this tool.
- It does not export as you pick files. You click Generate PDF after the previews appear.
- It does not keep a JPEG-only pipeline. The picker is
image/*.
Convert a local image
Pick JPEG or another image file, click Generate PDF, save images.pdf. No upload.
FAQ
- Does converting JPG to PDF upload my photos?
- No. Upload, preview, reorder, Generate PDF, and Clear all run in your browser. The page does not send the images or the PDF to a server.
- Does Generate PDF run as I pick files?
- No. Choosing files only reads them with FileReader.readAsDataURL and shows a preview. You click Generate PDF. The button stays disabled while the list is empty and while a generate is already running (the label then says Generating...).
- Is the picker JPEG-only?
- No. The hidden file input accepts image/* and keeps files whose MIME type starts with image/. JPEG, PNG, and GIF usually work. Types the browser or jsPDF cannot decode (for example many SVG or HEIC files) fail when you generate, with an alert.
- What file does Generate PDF save?
- jsPDF writes images.pdf, addImage always passed as JPEG. There is no quality slider, no page-size control, and no password option. The old “instant / professional / password-protected” claims were not about this page.