Solved

Javascript convert image format to .pdf

Posted on 2016-08-20
4
75 Views
Last Modified: 2016-08-21
Hello,  
Thanks for reading my post.  
Does anyone have example javascript code to convert image files to .pdf; example image format files are JPG, PNG, BMP, GIF, TIFF?  An example of the use case is employee expense reimbursement.  An employee digitizes their cash receipts; scenario A - captures an image of a cab ride receipt with his/her cell phone and scenario B - scans a hotel invoice with a mobile personal scanner.  The employee attaches two image format files to an e-mail requesting reimbursement.  The corporate accounts payable associate uses a workstation desktop image to pdf conversion utility to compile both images into a single .PDF file.   The single .PDF file is later uploaded into a Document Imaging Software.
0
Comment
Question by:jrbledsoe001
4 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 41763864
The answer is it depends.

If you are talking about Javascript when it runs on the client (browser) you will not be able to do the conversion stand alone.

You will need to have something on your server that does the conversion or you send the image to a 3rd party api that does the conversion for you and use the api to both upload then download.  

If you are talking about javascript that runs server side such as node, then you can use software like http://pdfkit.org/

On my sites, I use http://www.imagemagick.org and that can be used to convert using the command line http://www.imagemagick.org/script/command-line-processing.php convert image.jpg image.pdf

I believe just about all server side languages let you run at the command line via scripting.  I use both asp and php and works perfect.
1
 
LVL 21

Expert Comment

by:Kim Walker
ID: 41764040
I'm not sure this is doable in the scenario you've outlined. There is no point at which javascript can intervene when the images are attached to an email. You may need to look into a server-side solution that would retrieve the email and process the images into a PDF, then forward the PDF to the reimbursement personnel.
0
 

Author Comment

by:jrbledsoe001
ID: 41764490
Scott,  Thank you so much for responding to my post!  This is great information and right in line with my question.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 41764501
Sorry I missed this one when it came in (don't know how that happened), but my answer would have been similar to the one in your other question:
https://www.experts-exchange.com/questions/28964547/Powershell-to-convert-image-files-to-pdf.html

Once again, good luck on the project! Regards, Joe
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Microsoft Office Picture Manager has a Picture Shortcuts pane that shows a list with the Recently Browsed folders. While creating my video Micro Tutorial here at Experts Exchange showing How to Install Microsoft Office Picture Manager in Office 2013…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now