0

I am creating an application where I need to show PDFs rendering.
For that purpose I successfully installed the MuPDF library and I'm able to see PDFs successfully.

Now I am facing an issue.

I am not able to see PDFs fit to screen.
I followed this also, but no success.
I think I need to do some thing with this method.

private void measureView(View v) {}

Can anyone guide me?
How can I achieve this?

Community
  • 1
  • 1
Jay Vyas
  • 2,674
  • 5
  • 27
  • 58

1 Answers1

1

I would have called what the Android app does by default "fit to screen", so I'm not sure what you are trying to achieve, but if you want (say) the page to fit the width of the screen, you could try replacing, within measureView,

float scale = Math.min((float)getWidth()/(float)v.getMeasuredWidth(),
                (float)getHeight()/(float)v.getMeasuredHeight());

by

float scale = (float)getWidth()/(float)v.getMeasuredWidth();
Paul Gardiner
  • 468
  • 2
  • 7