use of net.sf.jasperreports.engine.PrintPageFormat in project jgnash by ccavanaugh.
the class JasperViewerDialogController method handleFitHeightAction.
@FXML
private void handleFitHeightAction() {
final PrintPageFormat pageFormat = jasperPrint.get().getPageFormat(pageIndex.get());
final double heightRatio = (scrollPane.getViewportBounds().getHeight() - (2 * PAGE_BORDER)) / pageFormat.getPageHeight();
final double widthRatio = (scrollPane.getViewportBounds().getWidth() - (2 * PAGE_BORDER)) / pageFormat.getPageWidth();
zoomComboBox.getSelectionModel().clearSelection();
setActualZoomRatio(heightRatio < widthRatio ? heightRatio : widthRatio);
}
Aggregations