Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding an image at a specified place in an existing PDF doc

New Here ,
Apr 29, 2008 Apr 29, 2008
Hi Guys

Does anyone know how to add an image to an existing PDF document where we have left a space for an image to be included programatically?

I'm using CF MX 7

All the best

Wez
TOPICS
Advanced techniques
822
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 29, 2008 Apr 29, 2008
If you do not mind dipping into java, you could use iText. It is built into MX7.

The tutorials should get you started. Though they are now a tad dated.
http://itextdocs.lowagie.com/tutorial/objects/images/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2008 Apr 30, 2008
Thank you for your reply. I had found IText before but wondered if there was as near pure CF solution as poss.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 30, 2008 Apr 30, 2008
Unless you are generating the pdf's with cfdocument and add the image when the files are generated, I think iText is about as close as it gets. Besides, iText is what cfdocument uses behind the scenes to generate pdf's anyway.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2008 Apr 30, 2008
Hi Wez,

How many pages does the PDF have? What is the image type, i.e. jpg, tiff, png? How do you wish to add the image, for example, on which page(s)? Where on the page is the space you reserve for the image? For example, what are the coordinates of the top-left corner of the rectangle?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2008 Apr 30, 2008
LATEST
Another look at your post tells me you probably want to insert the image on a single page. Here then is some code that should do it. I have included alternatives, for example, how to insert the image on every even-numbered page.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources