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

TOPIC:

Showing pages with different page sizes 10 years 7 months ago #3884

  • lukya
  • lukya's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
For a pdf file having pages with uneven size, the largest page fits the view correctly while the others are displayed smaller.
What i want obviously, is that all pages should fit the view correctly irrespective of page size.

One option would be to open pdf files and resize all pages to fit the screen correctly. This should be fine for pages with text and vector graphics. However, is not desirable in case where some pages have high resolution graphics which need to be zoomed while others can have simple image which will not look crips if the page size is increased.
Also, there is additional burden of either doing this activity every time i open a file or keeping track of which files are converted and which are not.

Is there an easier way to make sure that all pages fit the screen correctly?

I found another similar question but it does not have any satisfactory answer: www.androidpdf.mobi/forum/Android-develo...-to-screen-size#3623


EDIT 1: I need the same on iOS as well, but i do not want to spam by posting the same question twice. I am hoping there will be a common solution, but if theres a different way to solve this on android and iOS please let me know.

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

Last edit: by pkkori22.

Showing pages with different page sizes 10 years 7 months ago #3885

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
plz try Global.def_view = 2;
in Global.default_config()
this may be OK, but not the best way.

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

Showing pages with different page sizes 7 years 7 months ago #11207

  • thiagopelikan
  • thiagopelikan's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 0
Hi all,
I have this same problem, but Global.def_view = 2 does not help me, I still need zoom after page changed. Is there any other solution?

Tks,
Thiago

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

Showing pages with different page sizes 7 years 7 months ago #11208

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
To handle such a case, the best solution whould be to change vLayout method of the view mode you prefere (vertical, horizontal, single...).
You need to calculate the scale on the page level, instead of on the whole document.

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

Showing pages with different page sizes 7 years 7 months ago #11211

  • thiagopelikan
  • thiagopelikan's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 0
Hi,
I'm trying to do this for each page change:

pdfView.vSetScale(newScale, 0, 0);
pdfView.vCenterPage(currentPage);

The scale is correctly, it fits to the width, but my page is not centering correctly, it goes to the bottom of the screen and cuts a piece of bottom part of the page.

Is there anything else I could do to center the page?

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

Showing pages with different page sizes 7 years 7 months ago #11212

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Which view mode you are using?

Note:
  • The vertical mode --> fits according to screen width
  • The horizontal/single/dual mode --> fits according to screen height

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum