Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Viewer do not show all pages #7108

Closed
syhue opened this issue Nov 17, 2020 · 2 comments · Fixed by #7132
Closed

Document Viewer do not show all pages #7108

syhue opened this issue Nov 17, 2020 · 2 comments · Fixed by #7132
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects

Comments

@syhue
Copy link

syhue commented Nov 17, 2020

The document viewer started with the second page instead of the first page.

https://discourse.jabref.org/t/document-viewer-do-not-show-all-pages/2421

@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Nov 17, 2020
@Siedlerchr
Copy link
Member

Yep, I could confirm this in the 5.2-dev.
The page iterating happens here:

@Override
public ObservableList<DocumentPageViewModel> getPages() {
PDPageTree pages = document.getDocumentCatalog().getPages();
List<PdfDocumentPageViewModel> pdfPages = new ArrayList<>();
// There is apparently no neat way to get the page number from a PDPage...thus this old-style for loop
for (int i = 0; i < pages.getCount(); i++) {
pdfPages.add(new PdfDocumentPageViewModel(pages.get(i), i + 1, document));
}
return FXCollections.observableArrayList(pdfPages);

@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Nov 17, 2020
@Siedlerchr Siedlerchr added this to Normal priority in Bugs via automation Nov 17, 2020
Siedlerchr added a commit that referenced this issue Nov 27, 2020
Bugs automation moved this from Normal priority to Closed Nov 29, 2020
tobiasdiez pushed a commit that referenced this issue Nov 29, 2020
* Fix document viewer starting with second page

Fixes  #7108

* Fix update of total page number

* Fix checkstyle
@tobiasdiez
Copy link
Member

This should be fixed in the latest development version. Could you please check the build from http://builds.jabref.org/master/. Thanks! Please remember to make a backup of your library before trying-out this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Bugs
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants