Skip to main content
don_ashe
Participating Frequently
May 30, 2019
Question

Updating page after changing content

  • May 30, 2019
  • 1 reply
  • 536 views

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

This topic has been closed for replies.

1 reply

Brainiac
May 31, 2019

I find that notify method work fine for me. Are you using the PDFEdit API?

don_ashe
don_asheAuthor
Participating Frequently
May 31, 2019

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