The only other option that I can think of - which is a bit more work  
up front, but faster at match time, would be to use some unique ID  
from the database and store that as a custom key in the image's  
dictionary.  Then you can grab that back out during the loop over  
images and compare that.

Leonard

On Jun 23, 2008, at 1:38 AM, Anthony Oganesian wrote:

> No, I get my images from the database, and I use the following  
> method of
> adding it to the PDF:
>
> Image img = Image.getInstance(img_byte_array);
>
> But more importantly, when I parse the PDF in my click handler, all  
> I get is
> PdfStream which does not contain a name field.
>
> Based on your suggestion I currently checksum img.getRawData(), pass  
> the
> checksum in the URL and then as I loop through the streams, compare  
> it with
> the checksum of PdfReader.getStreamBytesRaw((PRStream) stream). If it
> matches I assume I got the same image.
>
> So, the current answer to my original question of what the F()  
> should be is:
>
> public String F(byte[] img_data)
> {
>       CRC32 checksum = new CRC32();
>       Checksum.update(img_data);
>       return String.valueOf(checksum.getValue());
> }
>
> Unless there is a more elegant way, I will stick with this solution.
>
> Leonard, thank you very much for you help!
>
> Tony.
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:itext-
>> [EMAIL PROTECTED] On Behalf Of Leonard  
>> Rosenthol
>> Sent: Sunday, June 22, 2008 1:50 PM
>> To: Post all your questions about iText here
>> Subject: Re: [iText-questions] image reference for a special
>> application
>>
>> image name == filename?
>>
>> Don't you have a path to the file when you added it to the PDF to
>> begin with?
>>
>> Leonard
>>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Do you like iText?
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Or leave a tip: https://tipit.to/itexttipjar
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to