- Posts: 80
- Thank you received: 0
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()
- arcmobile.div
- Topic Author
- Offline
- Premium Member
-
Less
More
10 years 9 months ago #9045
by arcmobile.div
Issue with the method RenderIsFinished() was created 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.
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.
10 years 9 months ago - 10 years 9 months ago #9048
by Davide
Replied by Davide on topic Issue with the method RenderIsFinished()
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:
and in the OnPDFSingleTapped method with:
and they seem to work properly and return true everytime.
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();
Code:
page.RenderIsFinished();
Last edit: 10 years 9 months ago by Davide.
- arcmobile.div
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 80
- Thank you received: 0
10 years 9 months ago #9098
by arcmobile.div
Replied by arcmobile.div on topic Issue with the method RenderIsFinished()
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 ?
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 ?
10 years 9 months ago #9139
by Davide
Replied by Davide on topic Issue with the method RenderIsFinished()
Hi,
can you please send us your code?
So we can check it and try to help you..
can you please send us your code?
So we can check it and try to help you..
- arcmobile.div
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 80
- Thank you received: 0
10 years 9 months ago - 10 years 9 months ago #9142
by arcmobile.div
Replied by arcmobile.div on topic Issue with the method RenderIsFinished()
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.
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.
Time to create page: 0.392 seconds