I have a custom layout (RelativeLayout) which holds a PDFLayoutView
and a custom toolbar (also a RelativeLayout with some imagebuttons)
First of all I want to detect if the user tapped on a visible signature field.
I think we can handle that by implementing the setOnTouchListener and converting the raw x and
y coordinates with the PDFLayout.PDFPos pdfPos = m_view.PDFGetPos(x, y);
I also want to draw some kind of overlay on visible signature fields (with known PDF coordinates).
I've started by implementing the PDFLayoutView.PDFLayoutListener() and the OnPageDisplayed
So I suppose it could be possible to draw a rectangle on the canvas...
How can I convert these PDF coordinates to the layout coordinates so that I can draw an rectangle on top of a visible signature field
(It's possible that this field is only visible after some scrolling...)
You can implement PDFLayoutListener.OnPDFAnnotTapped (which get fired when an annot is tapped) and filter based on Annot type and annot filed type to detect a signature field.
You can also get the annotation rectangle (position) in PDF coordinates and convert it to view coordinates to be used later in OnPageDisplayed, check the below code: