After I update the AP dictionary for an annotation, I call PDDocCreateThumbnails in order to update the page thumbnails shown to the user. If I examine the document contents, the Thumb page entry is updated appropriately, however the page thumbnail shown in the Acrobat UI does not update.
If I reduce or enlarge the thumbnails, they then update appropriately. Is there some method I'm missing that would allow me to force this update? Or a better way of generating the thumbnails? Thanks.
Are you sure you need to update the thumbnail image for the page? I have
not dealt with thumbnails in a long time. Acrobat and Reader (and I assume
all 3rd party tools that want to be taken seriously) will create the
thumbnails on the fly. The problem with embedded thumbnails is that when
you update the page, and you do not force an update of the thumbnail image,
you will still see the old thumbnail.
In your case, I assume that all you have to do is execute
PDPageContentsDidChange for the page in question, and Acrobat or Reader
will then automatically update the thumbnail.
Karl Heinz Kremer
PDF Acrobatics Without a Net
That worked beautifully. I was using the CreateThumbs function mostly because it was all I could find that seemed to deal with thumbnails (other than creating a PDThumbCreationServer which seemed like WAY overkill for me). I injected PDPageNotifyContentsDidChange() right after I wrote out the AP dictionary and all was well. Thanks!
Along these lines, do you know of a way to "back out" changes to the AP dictionary so they don't trigger a save dialog on close? Our appearances are so dynamic it doesn't make much sense to ask the users to save the document if thats the only write that would require a save. (I realize the answer to this is probably no... but it sure would be nice if I was wrong.
)
The save prompt is triggered by the dirty flag, when you clear that flag,
you will no longer get asked to save the file:
PDDocClearFlags(pdDoc, PDDocNeedsSave) will do that. Be careful however to
not clear that flag if the document was modified via other methods (besides
the AP dictionary). To avoid that, get the PDDocNeedsSave flag before you
modify the AP dict, and then after your modification, set it back to what
it was before your operation.
Karl Heinz Kremer
PDF Acrobatics Without a Net
North America
Europe, Middle East and Africa
Asia Pacific