Top Description Fields Constructors Methods
org.jabref.gui.documentviewer

public Class PdfDocumentPageViewModel

extends DocumentPageViewModel
Class Inheritance
Annotations
@AllowedToUseAwt:Requires AWT due to PDFBox
Imports
java.awt.Graphics2D, java.awt.image.BufferedImage, java.io.IOException, java.util.Objects, javafx.scene.image.Image, .PixelWriter, .WritableImage, org.jabref.architecture.AllowedToUseAwt, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.PDPage, org.apache.pdfbox.pdmodel.common.PDRectangle, org.apache.pdfbox.rendering.ImageType, org.apache.pdfbox.rendering.PDFRenderer

Represents the view model of a pdf page backed by a PDPage.

Field Summary

Modifier and TypeField and Description
private final org.apache.pdfbox.pdmodel.PDDocument
private final org.apache.pdfbox.pdmodel.PDPage
private final int

Constructor Summary

AccessConstructor and Description
public
PdfDocumentPageViewModel(org.apache.pdfbox.pdmodel.PDPage page, int pageNumber, org.apache.pdfbox.pdmodel.PDDocument document)

Method Summary

Modifier and TypeMethod and Description
private static Image
public double
getAspectRatio()

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.getAspectRatio.

Calculates the aspect ratio (width / height) of the page.

public int
getPageNumber()

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.getPageNumber.

Get the page number of the current page in the document.

public Image
render(int width, int height)

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.render.

Renders this page and returns an image representation of itself.

private static BufferedImage
resize(BufferedImage img, int newWidth, int newHeight)

Field Detail

documentback to summary
private final org.apache.pdfbox.pdmodel.PDDocument document
pageback to summary
private final org.apache.pdfbox.pdmodel.PDPage page
pageNumberback to summary
private final int pageNumber

Constructor Detail

PdfDocumentPageViewModelback to summary
public PdfDocumentPageViewModel(org.apache.pdfbox.pdmodel.PDPage page, int pageNumber, org.apache.pdfbox.pdmodel.PDDocument document)

Method Detail

convertToFxImageback to summary
private static Image convertToFxImage(BufferedImage image)
getAspectRatioback to summary
public double getAspectRatio()

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.getAspectRatio.

Doc from org.jabref.gui.documentviewer.DocumentPageViewModel.getAspectRatio.

Calculates the aspect ratio (width / height) of the page.

Annotations
@Override
getPageNumberback to summary
public int getPageNumber()

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.getPageNumber.

Doc from org.jabref.gui.documentviewer.DocumentPageViewModel.getPageNumber.

Get the page number of the current page in the document.

Annotations
@Override
renderback to summary
public Image render(int width, int height)

Implements abstract org.jabref.gui.documentviewer.DocumentPageViewModel.render.

Doc from org.jabref.gui.documentviewer.DocumentPageViewModel.render.

Renders this page and returns an image representation of itself.

Annotations
@Override
resizeback to summary
private static BufferedImage resize(BufferedImage img, int newWidth, int newHeight)