-
1. Re: about CosDocGetRoot
lrosenth Aug 17, 2009 7:26 PM (in response to ChromeUser)What do you mean "right" Cos ID? Is it not a valid ID? Does it not give you the correct object? Why do you even need the ID of an object?
-
2. Re: about CosDocGetRoot
ChromeUser Aug 17, 2009 7:31 PM (in response to lrosenth)I don't know if it's valid,but i open the PDF by a hex editor and find the "Catalog" ID is not the value returned by CosObjGetID().
-
3. Re: about CosDocGetRoot
lrosenth Aug 17, 2009 8:37 PM (in response to ChromeUser)When loaded into RAM, there is no promise that those IDs are stable. Those are the IDs in the physical file at the time it is loaded - nothing more.
-
4. Re: about CosDocGetRoot
ChromeUser Aug 17, 2009 8:42 PM (in response to lrosenth)That is i should reload the file?
-
5. Re: about CosDocGetRoot
lrosenth Aug 18, 2009 5:24 AM (in response to ChromeUser)No, I am just telling you that the IDs in the file were NEVER guaranteed by the SDK to be consistent with the memory representation. So if you built your solution around that, you may be (or have been) in for a shock.
Can you explain why you need that actual object IDs (or that the IDs match the file)?
-
6. Re: about CosDocGetRoot
ChromeUser Aug 18, 2009 6:25 PM (in response to lrosenth)The signature in PDF only ensure the content in sig range, for increment updated content it does not even for the updated content is another signature.
My task is parse the increment updated content after the signature.
If the updated content after the current sig is just a signature then current sig is valid.
So i need to know the object after the current sig.
I accomplish this by parsing the cross-reference table and find the object's offset larger than the sig range.
That's is why i should know the object's ID.
-
7. Re: about CosDocGetRoot
lrosenth Aug 18, 2009 8:38 PM (in response to ChromeUser)Correct, the signature is over a given byte range. Anything not in that range (such as stuff in subsequent update tables) is not included.
So you are choosing to do your own validation rules rather than stick with those in Acrobat/Reader. OK - that's your choice.
There are API calls to let you find out how many incremental update sections there are (CosDocEnumEOFs, I think it is called) and then determine whether a given object lives inside it (CosObjGetOffset, I think). No need to write your own parser, etc.
-
8. Re: about CosDocGetRoot
ChromeUser Aug 18, 2009 8:54 PM (in response to lrosenth)I have checked the SDK reference and have not found the method "CosObjGetOffset",there is just a callback "CosObjOffsetProc" which should be called during saving proc.
I have looked for the similar method before, but do not find it.so i parse the cross reference myself.
Thanks.
-
9. Re: about CosDocGetRoot
lrosenth Aug 19, 2009 4:27 AM (in response to ChromeUser)Sorry - the API call is CosDocObjIsWithinRange().
-
10. Re: about CosDocGetRoot
ChromeUser Aug 19, 2009 7:53 PM (in response to lrosenth)Using this method i should enum all the indirect objects(by CosDocEnumIndirect method) in document and then judge whether if it is out of sig range.
I'm not sure when the document has large amount objects could cause the CosDocEnumIndirect slowly.
I will test this method.
Thanks.


