• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Updating page after changing content

New Here ,
May 30, 2019 May 30, 2019

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

TOPICS
Acrobat SDK and JavaScript

Views

364

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2019 May 31, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2019 May 31, 2019

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines