Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Syntactic Confectionery Delight
 
PerlMonks  

Re: PDF::API2 fails combining pdf 1.3 and 1.4

by Anonymous Monk
on Feb 27, 2013 at 14:42 UTC ( #1020899=note: print w/ replies, xml ) Need Help??


in reply to PDF::API2 fails combining pdf 1.3 and 1.4

You could try CAM::PDF ;) appendpdf.pl - Append one PDF to another


Comment on Re: PDF::API2 fails combining pdf 1.3 and 1.4
Re^2: PDF::API2 fails combining pdf 1.3 and 1.4
by Anonymous Monk on Feb 27, 2013 at 15:51 UTC

    I could, but I need also to include also jpeg and tiff images. After a quick look, I had the impression that CAM::PDF does not support jpeg and tiff, but I may be in error, of course.

    Besides, I am not sure that this is a bug of PDF::API2. It could be an Acrobat's problem or the result of a malformed .pdf file. Unfortunately, I have no control on my source files. Interestingly, I tried to combine the two source .pdf with Acrobat pro 9 and it also fails, but in a different way. I tried also pdftk and found that it behaves in the same way as Acrobat pro.

    I may have to convert the .pdf into bitmaps and include them as such, but it seems a pity.

    Thanks,

    Giovanni

      I learned that you should not combine pdf files with different pdf versions. They can be converted by reinterpreting them in ghostscript, as below.

      gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=clean.pdf original.pdf # In windows, replace 'gs' with 'gswin32c.exe'

      that made the trick for me. It's trivial to call ghostscrip with 'exec' or 'system' from perl.

      It wasn't a perl problem and I should not have posted it in perlmonks, probably, but I wanted to share the solution anyway.

      Cheers

      Giovanni

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-04-18 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls