7 Replies - 2741 Views - Last Post: 06 January 2010 - 11:53 AM Rate Topic: -----

#1 Rocket452  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 03-April 08

how to identify/replace images in a pdf

Post icon  Posted 05 January 2010 - 02:43 PM

I need to selectively find and modify images in a pdf. Not all of the images only some. But I'm not sure how to return information on the pdfs so that I can change the images I need to change, and leave other images alone.

Another alternative would be to like add bookmarks to the pdf using Adobe Acrobat 9 and then use them like bookmarks so that my code will know where to put the new images.

any help would be appreciated

Is This A Good Question/Topic? 0
  • +

Replies To: how to identify/replace images in a pdf

#2 Theaegd  Icon User is offline

  • Hater & Lover

Reputation: -125
  • View blog
  • Posts: 944
  • Joined: 15-August 09

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 03:02 PM

if you could be bit for more specific I could help you, but I am not quite sure what you are attempting
Was This Post Helpful? 0
  • +
  • -

#3 Rocket452  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 03-April 08

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 03:33 PM

I have a program that is dynamically creating a pdf file.

There are images in the pdf that need to be modified based upon the user.

So i need my code to be able to identify the images I need to change in the generated pdf, so that I can modify them.
Was This Post Helpful? 0
  • +
  • -

#4 Theaegd  Icon User is offline

  • Hater & Lover

Reputation: -125
  • View blog
  • Posts: 944
  • Joined: 15-August 09

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 03:40 PM

OK, so you are trying to make pdf with image files in it, and you want the program to know what images need changing and what dont. If this accepts input, eg. the user says all images created on "this" date need to be modified ect. Then you could assign each image a constant integer, or string what ever works for what you are doing. Then the program will search through the integers ("links" to images) and find which ones have the integers code that matches the required images. You then add the integers to something such as a list, and go from there.
Did I do good, or do you want more specifics, or am I not answering your question? I hope I helped!
Was This Post Helpful? 0
  • +
  • -

#5 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 526
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 03:42 PM

I think the best question to ask here is: are you using any kind of 3rd party library to manipulate these PDFs that we should know about? If not, elaborate on "I have a program that is dynamically creating a pdf file." please.
Was This Post Helpful? 0
  • +
  • -

#6 Rocket452  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 03-April 08

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 04:29 PM

I am using Itextsharp library to generate the PDF.

I'm assuming that itextsharp or PDFsharp or a similiar library has a way for me to detect and identify the images in the PDF i'm creating but I'm not sure how to do that.
Was This Post Helpful? 0
  • +
  • -

#7 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 526
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: how to identify/replace images in a pdf

Posted 05 January 2010 - 04:59 PM

Have you read through the tutorial for ITextSharp? - http://itextsharp.so...orial/ch06.html

I'm sorry I'm not being more helpful. API troubleshooting is hard and involved and frankly I just cannot invest any time in learning this API to be of more help.
It seems to me though that the Document maintains a collection of image objects. You can use that collection and swap out various images I would guess.
Was This Post Helpful? 0
  • +
  • -

#8 Rocket452  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 03-April 08

Re: how to identify/replace images in a pdf

Posted 06 January 2010 - 11:53 AM

I've been looking at tutorial, but I just cant find the methods to get the images out of an existing PDF.

I need something like

ImageArray[] = document.getImages():

so that I can

ImageArray[2].modifyImage();
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1