Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
17

javascript for converting uploaded images into pdf

Contributor ,
Aug 12, 2023 Aug 12, 2023

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!

TOPICS
Edit and convert PDFs , How to , JavaScript , PDF forms , Scan documents and OCR
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2023 Aug 12, 2023

How do you see they are converted to PDF?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 12, 2023 Aug 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 13, 2023 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 13, 2023 Aug 13, 2023

Thank you Try67. I read another post regarding 'pdf bloating' caused by using the 'Save' button vs 'SaveAs' dialog box. It seems the "SaveAs" dialog overwrites the file, whereas the 'Save' only appends the modifications to the end of the file, effectively growing the file size each time it's applied. I took my original file and recreated it using the "create form" option which preservered all the functionality of the original form. I then completed the form as before, but used 'SavedAs' periodically rather than the 'Save' button. Everything worked fine and file size went from 100+mb to just over 11mb, which is sufficient for email. Script to get rid of that 'Save' button??? lol.... 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 13, 2023 Aug 13, 2023

here's the link to the forum dialogue I mentioned

https://community.adobe.com/t5/acrobat-discussions/how-to-reduce-the-size-of-pdf/m-p/8620335#M26680

Good luck everyone! Thank you!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 13, 2023 Aug 13, 2023
LATEST

Yes, this is kind of correct. Save As forces an optimization of the file, which can reduce its size by a lot.

And while it is possible to hide the Save button using a script, I would not recommend it. You'll just end up limiting yourself (or your users) for no good reason. It's better to have both options.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines