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

Issue with the method RenderIsFinished()

More
10 years 9 months ago #9045 by arcmobile.div
There is a method RenderIsFinished() in Page.java , package com.radaee.pdf
After document is rendered on the viewer , RenderIsFinished returns value true only once.
Next time onwards , whenever a call to the method RenderIsFinished() is done , the value is returned as false.
Kindly update.
More
10 years 9 months ago - 10 years 9 months ago #9048 by Davide
Hi,
can you please better explain your issue?
I've checked this method, as example in PDFPerformAnnot() method (called when you click an annotation and press the "do" button), using:
Code:
m_annot_page.GetPage().RenderIsFinished();
and in the OnPDFSingleTapped method with:
Code:
page.RenderIsFinished();
and they seem to work properly and return true everytime.
Last edit: 10 years 9 months ago by Davide.
More
10 years 9 months ago #9098 by arcmobile.div
After a document is rendered on the device screen , the RenderIsFinished() is returning true.
Now , let us assume that the user draws annotations like Line , Rectangle on the document and rendering is complete.
Now , I need to generate the bitmap of the document with annotations and not the entire screen. Here , I am facing issue generating the bitmap .
So , I checked the method RenderIsFinished() and its returning false.

What can the possible cause of the issue ?
More
10 years 9 months ago #9139 by Davide
Hi,
can you please send us your code?
So we can check it and try to help you..
More
10 years 9 months ago - 10 years 9 months ago #9142 by arcmobile.div
The document is rendered completely on the device , Now , the call to the RenderIsFinised is returning true.
Now , I am trying to generate the thumbnail of that specific page of the document on a button click using the following code:
public Bitmap generateThumbNails(Document mdoc, int pageNo, int quality) {
Page page = mdoc.GetPage(pageNo);
Bitmap bmp = null;
try {
float w = mdoc.GetPageWidth(pageNo);
float h = mdoc.GetPageHeight(pageNo);
bmp = Bitmap.createBitmap(quality, (int) (h / (w / quality)), Bitmap.Config.ARGB_8888);

int ih = (int) (h / (w / quality));
bmp.eraseColor(0);
float ratiox = quality / w;
float ratioy = ih / h;
if (ratiox > ratioy)
ratiox = ratioy;
if (!page.RenderThumb(bmp)) {
Canvas canvas = new Canvas(bmp);
Paint paint = new Paint();
paint.setARGB(255, 255, 255, 255);
canvas.drawRect((quality - w * ratiox) / 2, (ih - h * ratiox) / 2, (quality + w * ratiox) / 2, (ih + h
* ratiox) / 2, paint);
Matrix mat = new Matrix(ratiox, -ratiox, (quality - w * ratiox) / 2, (ih + h * ratiox) / 2);
page.RenderToBmp(bmp, mat);
mat.Destroy();
if (!page.RenderIsFinished()) {
bmp.recycle();
bmp = null;
}
}
page.Close();
} catch (Exception e) {
}
return bmp;
}

In the above code , RenderIsFinised is returning as false and an empty thumbnail is getting generated.
Kindly provide your inputs.
Last edit: 10 years 9 months ago by arcmobile.div.
More
10 years 8 months ago #9191 by support
Now the request is clear.
I should check in our framework code.
I'll update you as soon as possible.
Time to create page: 0.392 seconds
Powered by Kunena Forum