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

TOPIC:

FIT To SCreen 10 years 7 months ago #3942

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Hi,

Currently when we are rendering the first page of PDF in the screen using your PDFViewer , we are unable to render the entire page on
the screen of the device rather the full page is viewed only on scrolling mode.

We need to implement the Fit to screen for the first page of the PDF so that the entire page is visible on the screen without scrolling.
The topic has been locked.

FIT To SCreen 10 years 7 months ago #3943

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Any updates ?
The topic has been locked.

FIT To SCreen 10 years 7 months ago #3944

  • claudeh
  • claudeh's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 1
  • Thank you received: 0
Hi
The classes in charge to display a page apply systematically a fit width.
If you want apply a fit height, you have to modify few lines code.
For instance, if you use the PDFViewVert you have to modify the method : vert_set_ratio

private void vert_set_ratio()
{
if( m_doc == null ) return;
float max_w = m_doc.GetPageWidth(0);
float max_h = m_doc.GetPageHeight(0);
int page = 1;
int pages_cnt = m_doc.GetPageCount();
while( page < pages_cnt )
{
float w = m_doc.GetPageWidth(page);
float h = m_doc.GetPageHeight(page);
if( max_w < w ) max_w = w;
if( max_h < h ) max_h = h;
page++;
}

if(fitWidth)
ratio_min = (m_win_cx - m_page_gap) / max_w; // Default behavior
else { // added lines.....

// **To get a fit height
ratio_min = (m_win_cx - m_page_gap) / max_w;
float ratio_min2=(m_win_cy - m_page_gap) / max_h;
ratio_min=Math.min(ratio_min, ratio_min2);
}

Hope that will help
The topic has been locked.

FIT To SCreen 10 years 7 months ago #3945

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Hi,
This method exist in this package com.radaee.pdfex. But we are using package com.radaee.view where PDFViewVert call exist. So if we copy the class and paste there any problem is there.
Let us know because same class exist in two package but different code. we are using 2.9.2.

Thanks.
The topic has been locked.

FIT To SCreen 10 years 7 months ago #3946

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Hi,

Can we show the pdf in center of the screen. Suppose if your height fit then the view load from left side right side's some portion blank. So can we show center of the screen.

Thanks & Regards
The topic has been locked.

FIT To SCreen 10 years 7 months ago #3947

  • arcmobile.div
  • arcmobile.div's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Hi,

Any update on this!!!
The topic has been locked.
Powered by Kunena Forum