RadaeePDF.com :: Topic: Fit PDF to screen by width or height (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Fit PDF to screen by width or height

Fit PDF to screen by width or height 2 years 7 months ago #8070

  • phifa
  • phifa's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello everybody,

We are using pdfviewer-framework for Android. We display the PDF file with a PDFReader instance. Our goal is to fit the whole pdf file to the screen and center it if its needed. Currently the PDFReader instance fits the PDF file to the width of the screen. The result of this behaviour is, that if the PDF file is too big, the PDFReader fits it to the width and makes it scrollable.

The approach described in this post: www.androidpdf.mobi/forum/Android-develo...screen?start=12#5023 didn't work for us.
We set the scale to 0, but the behaviour of the PDFReader is the same. It fits the file to the width and makes it scrollable.

The two attachments describes the problem too. The first shows the behaviour we want and the second the behaviour we get.

Do we have to do something similar to the approach mentioned in this post: www.androidpdf.mobi/forum/Android-develo...start=0&start=6#3944

Then where we have to implement it? Is there a smarter solution to fix our problem?

Please let us know.

Regards
Philipp
Attachments:
The topic has been locked.

Fit PDF to screen by width or height 2 years 7 months ago #8110

  • phifa
  • phifa's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Any updates?
The topic has been locked.

Fit PDF to screen by width or height 2 years 7 months ago #8112

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 659
  • Thank you received: 38
  • Karma: 17
Have you tried to use the single layout??

by changing def_view = 3 in Global.default_config()
The topic has been locked.

Fit PDF to screen by width or height 2 years 7 months ago #8133

  • phifa
  • phifa's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Great, this worked for us! Now we get a gray background for the unfilled space. Is there any way to set it to white?

Thanks.

Regards
Philipp
The topic has been locked.

Fit PDF to screen by width or height 2 years 7 months ago #8134

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 659
  • Thank you received: 38
  • Karma: 17
By change back_color in PDFReader.PDFOpen and PDFReader.PDFSetView
The topic has been locked.

Fit PDF to screen by width or height 2 years 7 months ago #8135

  • phifa
  • phifa's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Worked. Thanks
The topic has been locked.
Powered by Kunena Forum