DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.17k stars 1.91k forks source link

Render short PDF pages at the top of the PDFView? #509

Open jeffdcamp opened 6 years ago

jeffdcamp commented 6 years ago

I have a PDF file with a lot pages in it. Each page is shown separately in a view pager (I'm using a view pager to swipe left-right between each page). Some of the pages have a short height and other have a long height. Long pages render properly with the top of the page showing at the top of the PDFView and the ability scroll the pdf page. The short ones render in the middle of the PDFView (leaving white space on top and bottom).

Is there a way to render short PDF pages in the PDFView at the top of the view (leaving ONLY whitespace at the bottom)?

Here is my view:

    <com.github.barteksc.pdfviewer.PDFView
        android:id="@+id/pdfView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
barteksc commented 6 years ago

Pages are rendered continuously one after another, there are no spaces between pages

jeffdcamp commented 6 years ago

I'm only trying to show a single page... the single page is a short (in height) page. When the page renders in the PDFView, it shows in the middle of the screen (white space on top and bottom)... I would like the single page to show at the top of the screen.

Example of code to show the single page

pdfView.fromFile(myFile)
    .pages(8)
    .load();
barteksc commented 6 years ago

Unfortunately there is no such possibility

1stmetro commented 6 years ago

could you post a screen shot so i can see what you are trying to do ?

jeffdcamp commented 6 years ago

image