Correct, it will NOT be just the ID - it can well be any number of  
things.  This is NOT the way to compare PDFs.

Adobe Acrobat Professional has a nice PDF compare feature you can use.

Leonard

On Apr 22, 2008, at 5:31 PM, kan wrote:

> Yeah, I see. I have a lot complicated data, a lot of formatting rules
> which form one PDF document at the end. After some changes in
> data/formatters/etc I need to rebuilt report and show user if he need
> to pay attention if something actually has been changed. It's not easy
> to track all dependencies in code, so much easier to compare output
> with previously saved one. So, I invoke the same itext-API methods in
> the same order, so I expect to have the same document, but it's not
> only because that ID.
> Can I just comment out that code for now, so it will not put ID at
> all? What can it affect? Could it break some versions of Adobe Reader?
>
> Maybe it's possible in future versions just calculate some
> checksum/hash (like CRC/MD5/SHA1) from written data to produce
> "stable" ID...
>
> 2008/4/22 Leonard Rosenthol <[EMAIL PROTECTED]>:
>> The ID is just that - a unique ID for each document, regardless of
>>  content.   For any two documents that are NOT actual copies - the ID
>>  should be different.
>>
>>  In addition, PDF is NOT designed to be "binary compatible" when
>>  creating a document from the same content.  There are many variables
>>  that can be introduced that will cause objects to be ordered
>>  differently, named differently, etc.
>>
>>  Perhaps if you explained WHY you need things to work this way - we
>>  can give you more guidance.
>>
>>  Leonard
>>
>>
>>
>>  On Apr 22, 2008, at 3:32 PM, kan wrote:
>>
>>> Hi, everyone!
>>>
>>> I'm using the library to generate PDF. I've found the library
>>> generates different document even if content is absolutely the  
>>> same. I
>>> examined the library source code and found a reason. This is an ID
>>> field in a trailer of each document. Somewhere inside PdfWriter  
>>> there
>>> is code:
>>> fileID = PdfEncryption.createInfoId(PdfEncryption.createDocumentId 
>>> ());
>>> and createDocumentId() generates different id based on some random
>>> stuff like milliseconds, etc.
>>>
>>> I want to have ability to generate documents which are binary  
>>> equal if
>>> they have same content, but that random ID prevents it. Is there any
>>> proper way to avoid it? What is that field for? Can I just  
>>> comment it
>>> out in library source code? Does it break anything? Or maybe is  
>>> there
>>> better way?
>>>
>>> --
>>> WBR, kan.
>>>
>>> -------------------------------------------------------------------- 
>>> --
>>> ---
>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>>> Don't miss this year's exciting event. There's still time to save
>>> $100.
>>> Use priority code J8TL2D2.
>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://
>>> java.sun.com/javaone
>>> _______________________________________________
>>> iText-questions mailing list
>>> iText-questions@lists.sourceforge.net
>>> 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
>>>
>>
>>
>>   
>> --------------------------------------------------------------------- 
>> ----
>>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>>  Don't miss this year's exciting event. There's still time to save  
>> $100.
>>  Use priority code J8TL2D2.
>>  http://ad.doubleclick.net/clk;198757673;13503038;p?http:// 
>> java.sun.com/javaone
>>  _______________________________________________
>>  iText-questions mailing list
>>  iText-questions@lists.sourceforge.net
>>  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
>>
>
>
>
> -- 
> WBR, kan.
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save  
> $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http:// 
> java.sun.com/javaone
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> 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
>


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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