Copy link to clipboard
Copied
I have a plug-in I am porting back over from PDFLibrary to Acrobat.
The plug-in modifies the color of every object on the page that has a color attribute: vector, gradients, images, etc.
It works great in PDLibrary and has for many yeas now.
In Acrobat, the same process never updates the window until I save the document.
The pattern I use iterates through pages like this:
PDPage page = PDDocAcquirePage(pdDoc,i);
ModifyObjects...
PDPageNotifyContentsDidChange(page);
PDPageRelease(page);
At the end I call:
AVPageView pageView = AVDocGetPageView (avDoc);
AVPageViewInvalidateRect (pageView,NULL);
AVPageViewDrawNow (pageView);
But the page doesn't redraw until I save it. I've tried the usual tricks with zooming in/out and that doesn't work either.
Any clues as to where to look?
Thanks!
-Don
Copy link to clipboard
Copied
I find that notify method work fine for me. Are you using the PDFEdit API?
Copy link to clipboard
Copied
Good to know.
I am using PDE and Cos object calls.
It looks like updating text and other vector items is refreshing properly, but images are not.
I'm using a simple PDE based process to edit images, e.g.:
PDEImageGetData(pdeImage,0,imageData);
for(ASInt32 i = 0;i< len;i+=4)
{
citeEngine->AdjustPixel(&imageData);
}
PDEImageSetData(pdeImage,0,imageData,len);
And it actually works fine once I've saved the file, so I'm wondering if I'm either
a. forgetting to release an object somewhere
or
b. not properly notifying Acrobat that the image data has been updated (I thought PDEImageSetData would do that...)
or
c. ?
Thanks!
-Don