Skip to main content
Known Participant
March 10, 2017
Answered

How do you get a draw rectangle to stay displayed

  • March 10, 2017
  • 1 reply
  • 3344 views

I drew a rectangle on a document using the function AVPageViewDragOutNewRect, however, the rectangle flashes on the screen for a second and then disappears. How do I go about getting he rectangle to remain showing?

This topic has been closed for replies.
Correct answer Dan_Korn

Your code itself looks fine, but where are you calling it from?  You should do drawing only during one of the drawing callbacks, i.e. a handler for AVAnnotHandlerDrawProc or AVAnnotHandlerDrawExProc., or a function passed to AVAppRegisterForPageViewDrawing.

1 reply

lrosenth
Adobe Employee
Adobe Employee
March 10, 2017

Something that is part of the PDF itself? Look at the PDEdit layer of APIs

LWShayAuthor
Known Participant
March 10, 2017

I actually don't need the rectangle to be apart of the PDF itself. I just want it to remain displayed on the page and get the AVFixedRect associated with it. As of right now I can get the rectangle but I can't get it to stay. Here is a sample code.

AVPageViewDragOutNewRect(pageView,xHit,yHit,&resultRect);

ASFixedRect fixedRect;

AVPageViewDeviceRectToPage(pageView,&resultRect,&fixedRect);

AVPageViewGhostRectOutline(pageView, &resultRect);

AVPageViewInvalidateRect(pageView, &resultRect);

AVPageViewDrawNow (pageView);

AVPageViewDrawRect(pageView, &resultRect);

LWShayAuthor
Known Participant
March 13, 2017

Your code itself looks fine, but where are you calling it from?  You should do drawing only during one of the drawing callbacks, i.e. a handler for AVAnnotHandlerDrawProc or AVAnnotHandlerDrawExProc., or a function passed to AVAppRegisterForPageViewDrawing.


I'm calling it from a DoClick function