Page 1 of 1

Adding image to pdf

Posted: 2016-12-22T16:16:43-07:00
by GarbageSauce
Hi everybody. So I have a pdf file and I was looking for the easiest way to add a png to the pdf at a specified location (x,y). I have tried a few things such as the montage command but that wasn't cutting it. Thanks!

Re: Adding image to pdf

Posted: 2016-12-22T16:36:53-07:00
by anthony
First PDF is a vector image format, but ImageMagick is a raster image processor. If IM reads a PDF it will render it into a raster (pixel array) at a specific resolution/density. That is probably not what you want. See the warning...

A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector


Adding images to a PDF is not easy as it is a propriety Adobe Format. You can get a reader from them for free, but editors generally cost!

See PDF Output Alternatives
http://www.imagemagick.org/Usage/format ... turnatives

It isn't much, but it is a very difficult task without knowing a lot more information about the PDF, the image and what it is exactly you want to do!
There are lots of ways to skin a cat, and what method you use depends
on what you want that skin for, and how messy you like the results!
-- Anthony Thyssen

Re: Adding image to pdf

Posted: 2017-01-05T19:00:46-07:00
by GarbageSauce
Well I guess I have nowhere to go from here then. The only thing I was trying to do was replace an in-house software we use that tiles a bunch of the same image on a pdf. The SDK that the software uses is Pycairo. I was looking to reduce the process of creating such PDF's to a single executable rather than a bunch of handwritten python scripts. Anyways, it was worth a try. Thanks man.

Re: Adding image to pdf

Posted: 2017-01-05T21:33:13-07:00
by fmw42
You can add an image onto a PDF in IM convert, but the quality may not be as good as desired without some work.

If your PDF has some images already contained in it, then the best thing would be to remove the composite image from the PDF vector shell, composite the new image, then convert the result back to PDF. IM can do all but remove the image from the vector shell. But you can do that with pdfimages.

"You can extract the raster images directly using "pdfimages" program, which is part of either the poppler-utils or the "xpdf-utils software packages. These software packages also contain many other tools that you can find useful for PDF processing. See Popler for Windows.

See
https://poppler.freedesktop.org
http://blog.alivate.com.au/poppler-windows


Please always provide your IM version and platform, since syntax may differ. Also it might help to see what you are trying to do, if you upload your PDF and the image you want to add to the PDF and explain where you want it added. And/or the command you tried.

Please read the top post in this forum at "IMPORTANT: Please Read This FIRST Before Posting:"
viewtopic.php?f=1&t=9620