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

TOPIC:

Issue with the method RenderIsFinished() 8 years 10 months ago #9045

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
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.

Please Log in or Create an account to join the conversation.

Issue with the method RenderIsFinished() 8 years 10 months ago #9048

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
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:
m_annot_page.GetPage().RenderIsFinished();
and in the OnPDFSingleTapped method with:
page.RenderIsFinished();
and they seem to work properly and return true everytime.

Please Log in or Create an account to join the conversation.

Last edit: by Davide.

Issue with the method RenderIsFinished() 8 years 10 months ago #9098

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
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 ?

Please Log in or Create an account to join the conversation.

Issue with the method RenderIsFinished() 8 years 10 months ago #9139

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
can you please send us your code?
So we can check it and try to help you..

Please Log in or Create an account to join the conversation.

Issue with the method RenderIsFinished() 8 years 10 months ago #9142

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
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.

Please Log in or Create an account to join the conversation.

Last edit: by arcmobile.div.

Issue with the method RenderIsFinished() 8 years 9 months ago #9191

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
Now the request is clear.
I should check in our framework code.
I'll update you as soon as possible.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum