Skip to main content
Inspiring
August 12, 2023
Question

javascript for converting uploaded images into pdf

  • August 12, 2023
  • 1 reply
  • 1306 views

I have a large pdf form with many pages, each containing a single image field for the User to upload an image of a document. These images I expect will be taken with their cell phone camera, and saved as jpeg files. When the User goes to upload these, I notice scans in jpeg format are automatically coverted to pdf, but those taken as pictures and in jpeg format are not converted. Is there a workaround script to insure the image is uploaded into the pdf format? Goal is to reduce overall filesize without the User having to use any of the Adobe tools. Possible? Thanks in advance!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 12, 2023

How do you see they are converted to PDF?

Inspiring
August 12, 2023

I have a scan option on my camera. Those from the scan option that I uploaded had an alert window indicating the uploaded file was being saved as a pdf. The ones taken from the regular camera app also saved as jpeg but did not throw the alert when uploaded and expanded the pdf file size proportionately- I'm assuming they're inserted as jpegs and not pdf?

try67
Community Expert
Community Expert
August 13, 2023

Yes, if that's what they are... I think the solution needs to come from your scanning app. You need to change its settings to save the scans as image files, not PDF. This is not possible to do once they are incorporated into the PDF, at least not using a script. You can export the PDF pages to image files, though.