Drawing a stamp - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Drawing a stamp

Drawing a stamp 1 year 2 months ago #12844

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
How do I draw a stamp programatically?

on the PDFLayoutView I tried to use the following

// start drawing stamp
PDFSetStamp(0);


// programatically create stamp, using code from onDrawStamp()
if (m_status == STA_STAMP && canvas != null) {
if (m_icon != null) {
Rect rc = new Rect();
rc.left = left;
rc.top = top;
rc.right = right;
rc.bottom = bottom;

// crash here <<<<<<<<<<<<<
canvas.drawBitmap(m_icon, null, rc, null);

}
}

// end
PDFSetStamp(1);


the canvas i get here
public void OnPageDisplayed(Canvas canvas, VPage vpage) {
this.canvas = canvas;
this.vpage = vpage;
}

Please advise, drawing a selection using this canvas seems to work fine.

Please Log in or Create an account to join the conversation.

Drawing a stamp 1 year 2 months ago #12850

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
It's not clear what is the cause of the crash, but i advice you to get the canvas from PDFLayoutView.onDraw(Canvas canvas)
instead of OnPageDisplayed (as this is a callback that gets called based on conditions)

If you still have problems, can you send us the whole modified PDFLayoutView class so we can test it.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum