Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!panix.com!forkosh From: John Forkosh Newsgroups: comp.lang.postscript Subject: Re: JPEG to PDF question Date: Sun, 7 Apr 2019 06:39:11 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 37 Message-ID: References: NNTP-Posting-Host: panix3.panix.com X-Trace: reader2.panix.com 1554619151 11141 166.84.1.3 (7 Apr 2019 06:39:11 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 7 Apr 2019 06:39:11 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (NetBSD/7.1.2 (i386)) Xref: csiph.com comp.lang.postscript:3366 Eli the Bearded <*@eli.users.panix.com> wrote: > For the task of submitting receipts to a web form that only accepts PDF > files, I'd like to be able to easily turn JPEGs into PDF. Today I had > one that I converted with Gimp, using "export as" > > -rw-rw-r-- 1 username username 585211 Apr 6 14:13 /tmp/statement.jpg > -rw-rw-r-- 1 username username 5113015 Apr 6 14:14 /tmp/statement.pdf > > This worked, but it's not great. Besides the PDF requirement, there's > also a file size cap which I just barely made it under (5MB: 5242880 > bytes). It's easy to see how the next one might not fit in 5MB with that > 8.7x file enlargement Gimp gave me. > > It looks like Gimp put a 1500x2000 JPEG as a 1500x2000 RGB bitmap with > only flate compression. This is 8.7x larger than JPEG and only 1.7x > smaller than raw binary RGB. > > What's a better way to do this? Unix (Linux) command line preferred. Gui > (like Gimp) acceptable but not great. Bonus if it can create a multiple > page PDF from individual images. > > Elijah > ------ > also acceptable convert to some other intermediate image format first One Linux command line tool for jpg->pdf would be ImageMagick's convert convert anyfile.jpg anyfile.pdf No filesize cap (that I'm aware of), but can't say whether or not it's "better" with respect to your other problems. And it's probably one-to-one with respect to "multiple pages", but then pdfjam pdfjam pagenum*.pdf --outfile allpages.pdf will definitely do that. And check out both programs' manpages for numerous (and I do mean numerous) other -switches. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )