Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Convert PDF coordinates to view layout coord

More
IP: 192.168.0.71 8 years 5 months ago #13019 by Davide
Hi,
I have checked your project and you are not activating the demo license correctly.
As written here : www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=4
You have to change the applicationId in app.gradle to test the license in your own project :
Code:
applicationId "com.radaee.reader"
More
IP: 192.168.0.71 8 years 5 months ago #13021 by geertvm
Hi,
I see the signature annotations with the premium licence correctly enabled.
I have a strange behaviour with the same sample/same pdf.
I've enabled the callbacks
m_view.PDFOpen(m_doc, this);

And in the OnPDFAnnotTapped
the first time I click it's recognised, the second time the annotations is null, the third time it's again OK....


@Override
public void OnPDFAnnotTapped(VPage vpage, Page.Annotation annot) {

Log.d(TAG, "OnPDFAnnotTapped...");

if (annot != null) {
int type = annot.GetType();
int ft = annot.GetFieldType();

Log.d(TAG, "TYPE = " + type);
Log.d(TAG, "FIELD TYPE = " + ft);
}

if (annot != null && annot.GetType() == 20 && annot.GetFieldType() == 4) {
Log.d(TAG, "OnPDFAnnotTapped...SIGNATURE....");

float[] annotRect = annot.GetRect();
float tmp = annotRect[1];
annotRect[0] = vpage.GetVX(annotRect[0]) - m_view.PDFGetX();
annotRect[1] = vpage.GetVY(annotRect[3]) - m_view.PDFGetY();
annotRect[2] = vpage.GetVX(annotRect[2]) - m_view.PDFGetX();
annotRect[3] = vpage.GetVY(tmp) - m_view.PDFGetY();
}
}
More
IP: 192.168.0.71 8 years 5 months ago #13026 by Davide
Hi,
this is the standard behavior of the library.
With the first tap you select the annot, with the second you unselect it.

If you want to change this behavior, you can modify onSingleTapConfirmed of PDFLayoutView and handle it as you want..
More
IP: 192.168.0.71 8 years 5 months ago #13062 by geertvm
Hi,

When clicking on a signature field, the document view scrolls after handling the click event
The document view should stay the same...

What we now basically do is:
1/ Select signature fields with the setOnTouchListener
We compare the coordinates with the know PDF coordinates.
We don't use the OnPDFAnnotTapped. The behaviour is not exactly what we want...

2/ Add some overlay on top of the view
@Override
public void onPDFPageDisplayed(Canvas canvas, VPage vpage) {
drawSignatureFields(canvas, vpage);
}

The test app can be downloaded from
www.dropbox.com/s/xrf6kagyrjlt44q/PdfViewSup.zip?dl=0

Regards,
More
IP: 192.168.0.71 8 years 5 months ago #13065 by Davide
Hi,
I have checked your project, please modify the isHandled value in MainActivty at line 216 :
Code:
isHandled = false;

After that edit seems to work properly, please check it and let us know..
More
IP: 93.34.225.185 7 years 11 months ago - 7 years 11 months ago #13768 by mfranc28
Having issue with
if(annot != null && annot.GetType() == 20 && annot.GetFieldType() == 4) {

Operator '==' cannot be applied to operands of type 'Type' and 'Int'

Then, how can I convert this:
float[] annotRect = annot.GetRect();
float tmp = annotRect[1];
annotRect[0] = vpage.GetVX(annotRect[0]) - m_view.PDFGetX();
annotRect[1] = vpage.GetVY(annotRect[3]) - m_view.PDFGetY();
annotRect[2] = vpage.GetVX(annotRect[2]) - m_view.PDFGetX();
annotRect[3] = vpage.GetVY(tmp) - m_view.PDFGetY();

to X and Y screen coordinate?
Last edit: 7 years 11 months ago by mfranc28.
Time to create page: 0.399 seconds
Powered by Kunena Forum