converting jpg to pdf without imagemagick

Patton Echols p.echols at comcast.net
Mon Oct 11 01:47:49 UTC 2010


On 10/10/2010 01:02 PM, NoOp wrote:
> On 10/10/2010 11:12 AM, David Fletcher wrote:
>   
>> On Sunday 10 Oct 2010, Jozsef Vadkan wrote:
>>     
>>> after trying to convert 173 jpg files to one pdf:
>>>
>>> strace convert *.jpg ../outpud.pdf -verbose
>>> ...
>>>       
>> Try using gscan2pdf. I've only ever used it to scan documents to pdfs as a 
>> backup copy before sending them through the post, but when I saw your request 
>> just now, I looked to see if it has an import function, and it does.
>>     
>
> http://packages.ubuntu.com/lucid/gscan2pdf
> depends:
> imagemagick
>
>
>   

True, but I don't interpret that to be OP's objection.  Gscan2pdf does 
solve the problem, at least paritally / mostly. 

I tried it on my system.  While 'convert *.jpg result.tif' succeeds in 
creating a multipage tiff, but 'convert *.jpg result.pdf' fails with 
"Segmentation fault".

But I am able to use gscan2pdf to import large number of jpegs write 
pdf.  I say the problem is only "mostly" solved because it does not 
appear that you can feed a group of images from a command line and 
automatically spit out a pdf.  (Not really surprising for a GUI tool)

If a command line soltution is needed, maybe make the intermediate tiff 
and then use tiff2pdf.  Try the -n switch if you get weird colors, the 
-j switch to recompress and -q <qual> to set jpeg compression if you 
don't like the default.  Oh, and the default output is stdout, so you 
need an explicit -o <filename>.

As you can tell, I fiddled a little.  I could not figure out how to get 
tiff2pdf to take input from stdin  anyone who's had success can chime in.

-- PE






More information about the ubuntu-users mailing list