Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Drawing a stamp 6 years 7 months ago #12844

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • 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 6 years 7 months ago #12850

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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