From 02221ff454c8147c1c979c26dd8f8a754cd175d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ce=C4=BEuch?= Date: Mon, 3 Jun 2024 14:19:16 +0200 Subject: [PATCH 1/5] try pdf box to render pdf as images --- pom.xml | 56 +-------- .../core/visualization/PDFVisualization.java | 30 ++++- .../core/visualization/Visualization.java | 4 +- .../slovensko/autogram/ui/Visualizer.java | 4 +- .../slovensko/autogram/ui/gui/GUI.java | 11 +- .../ui/gui/SigningDialogController.java | 10 +- .../autogram/ui/gui/visualization-pdf.html | 118 ++---------------- 7 files changed, 64 insertions(+), 169 deletions(-) diff --git a/pom.xml b/pom.xml index 5c95e8502..88081b115 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 6.0 2.10.1 4.5.14 - 2.10.377 + 2.0.30 12.4 2.12.1 2.0.13 @@ -97,6 +97,11 @@ httpclient ${apache.httpcomponents.version} + + org.apache.pdfbox + pdfbox + ${pdfbox.version} + net.sf.saxon Saxon-HE @@ -297,55 +302,6 @@ - - org.codehaus.mojo - wagon-maven-plugin - 2.0.2 - - - download-pdfjs-main - initialize - - download-single - - - - https://cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/build/pdf.min.js - - ${project.resources[0].directory}/digital/slovensko/autogram/ui/gui/vendor/pdfjs - true - - - - download-pdfjs-worker - initialize - - download-single - - - - https://cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js - - ${project.resources[0].directory}/digital/slovensko/autogram/ui/gui/vendor/pdfjs - true - - - - download-pdfjs-cmaps - initialize - - download - - - https://cdn.jsdelivr.net/npm/pdfjs-dist@${pdfjs.version} - cmaps - - ${project.resources[0].directory}/digital/slovensko/autogram/ui/gui/vendor/pdfjs/cmaps - - - - - com.igormaznitsa mvn-jlink-wrapper diff --git a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java index e4cfc1e8c..07eb8471c 100644 --- a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java +++ b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java @@ -1,12 +1,22 @@ package digital.slovensko.autogram.core.visualization; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Base64; +import digital.slovensko.autogram.core.FailedVisualizationException; import digital.slovensko.autogram.core.SigningJob; +import digital.slovensko.autogram.core.errors.AutogramException; import digital.slovensko.autogram.ui.Visualizer; import eu.europa.esig.dss.model.DSSDocument; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.rendering.ImageType; +import org.apache.pdfbox.rendering.PDFRenderer; + +import javax.imageio.ImageIO; public class PDFVisualization extends Visualization { private final DSSDocument document; @@ -24,9 +34,25 @@ private String getBase64EncodedDocument() { } } + private ArrayList getHTML() throws IOException { + var pdfDocument = PDDocument.load(this.document.openStream()); + var pdfRenderer = new PDFRenderer(pdfDocument); + var divs = new ArrayList(); + for (int page = 0; page < pdfDocument.getNumberOfPages(); ++page) { + var os = new ByteArrayOutputStream(); + var bim = pdfRenderer.renderImageWithDPI(page, 300, ImageType.RGB); + ImageIO.write(bim, "png", os); + divs.add("
"); + } + + pdfDocument.close(); + + return divs; + } + @Override - public void initialize(Visualizer visualizer) { + public void initialize(Visualizer visualizer) throws IOException { visualizer.setPrefWidth(getVisualizationWidth()); - visualizer.showPDFVisualization(getBase64EncodedDocument()); + visualizer.showPDFVisualization(getHTML()); } } \ No newline at end of file diff --git a/src/main/java/digital/slovensko/autogram/core/visualization/Visualization.java b/src/main/java/digital/slovensko/autogram/core/visualization/Visualization.java index 243599431..f0dc0a7ec 100644 --- a/src/main/java/digital/slovensko/autogram/core/visualization/Visualization.java +++ b/src/main/java/digital/slovensko/autogram/core/visualization/Visualization.java @@ -3,6 +3,8 @@ import digital.slovensko.autogram.core.SigningJob; import digital.slovensko.autogram.ui.Visualizer; +import java.io.IOException; + public abstract class Visualization { private final SigningJob job; @@ -10,7 +12,7 @@ protected Visualization(SigningJob job) { this.job = job; } - public abstract void initialize(Visualizer visualizer); + public abstract void initialize(Visualizer visualizer) throws IOException; public SigningJob getJob() { return job; diff --git a/src/main/java/digital/slovensko/autogram/ui/Visualizer.java b/src/main/java/digital/slovensko/autogram/ui/Visualizer.java index 1ebc86463..946847351 100644 --- a/src/main/java/digital/slovensko/autogram/ui/Visualizer.java +++ b/src/main/java/digital/slovensko/autogram/ui/Visualizer.java @@ -2,10 +2,12 @@ import eu.europa.esig.dss.model.DSSDocument; +import java.util.ArrayList; + public interface Visualizer { void showUnsupportedVisualization(); - void showPDFVisualization(String base64EncodedDocument); + void showPDFVisualization(ArrayList base64EncodedDocument); void showHTMLVisualization(String document); diff --git a/src/main/java/digital/slovensko/autogram/ui/gui/GUI.java b/src/main/java/digital/slovensko/autogram/ui/gui/GUI.java index d405831cb..79f00e412 100644 --- a/src/main/java/digital/slovensko/autogram/ui/gui/GUI.java +++ b/src/main/java/digital/slovensko/autogram/ui/gui/GUI.java @@ -319,7 +319,16 @@ public void showVisualization(Visualization visualization, Autogram autogram) { var controller = new SigningDialogController(visualization, autogram, this, title, userSettings.isSignaturesValidity()); jobControllers.put(visualization.getJob(), controller); - var root = GUIUtils.loadFXML(controller, "signing-dialog.fxml"); + Parent root; + try { + root = GUIUtils.loadFXML(controller, "signing-dialog.fxml"); + } catch (AutogramException e) { + showError(e); + return; + } catch (Exception e) { + showError(new UnrecognizedException(e)); + return; + } var stage = new Stage(); stage.setTitle(title); stage.setScene(new Scene(root)); diff --git a/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java b/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java index 900c9dd7f..15f00653d 100644 --- a/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java +++ b/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java @@ -26,6 +26,9 @@ import javafx.stage.Modality; import javafx.stage.Stage; +import java.io.IOException; +import java.util.ArrayList; + import static digital.slovensko.autogram.ui.gui.GUIValidationUtils.*; public class SigningDialogController implements SuppressedFocusController, Visualizer { @@ -73,7 +76,7 @@ public SigningDialogController(Visualization visualization, Autogram autogram, G this.shouldCheckValidityBeforeSigning = shouldCheckValidityBeforeSigning; } - public void initialize() { + public void initialize() throws IOException { headerText.setText(title); signaturesTable.setManaged(false); signaturesTable.setVisible(false); @@ -298,13 +301,12 @@ public void showHTMLVisualization(String html) { webViewContainer.setManaged(true); } - public void showPDFVisualization(String base64EncodedPdf) { + public void showPDFVisualization(ArrayList data) { var engine = webView.getEngine(); engine.setJavaScriptEnabled(true); engine.getLoadWorker().stateProperty().addListener((observable, oldState, newState) -> { if (newState == Worker.State.SUCCEEDED) { - engine.executeScript( - "displayPdf('" + base64EncodedPdf + "')"); + engine.executeScript("displayPdf(['" + String.join("', '", data) + "'])"); } }); engine.load(getClass().getResource("visualization-pdf.html").toExternalForm()); diff --git a/src/main/resources/digital/slovensko/autogram/ui/gui/visualization-pdf.html b/src/main/resources/digital/slovensko/autogram/ui/gui/visualization-pdf.html index d20dc5ff9..c10129f22 100644 --- a/src/main/resources/digital/slovensko/autogram/ui/gui/visualization-pdf.html +++ b/src/main/resources/digital/slovensko/autogram/ui/gui/visualization-pdf.html @@ -19,11 +19,16 @@ flex-direction: column; } - #container > * { + #container > div { + width: 95%; border: 2px solid #0b0c0c; margin: 0 24px 15px 0; } + #container > div > img { + width: 95%; + } + #container > *:last-child { margin-bottom: 0; } @@ -34,117 +39,10 @@
From 2b71e5871a09a8af9db608540091706927492bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ce=C4=BEuch?= Date: Mon, 3 Jun 2024 14:28:16 +0200 Subject: [PATCH 2/5] use lower dpi --- .../slovensko/autogram/core/visualization/PDFVisualization.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java index 07eb8471c..b754a4044 100644 --- a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java +++ b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java @@ -40,7 +40,7 @@ private ArrayList getHTML() throws IOException { var divs = new ArrayList(); for (int page = 0; page < pdfDocument.getNumberOfPages(); ++page) { var os = new ByteArrayOutputStream(); - var bim = pdfRenderer.renderImageWithDPI(page, 300, ImageType.RGB); + var bim = pdfRenderer.renderImageWithDPI(page, 100, ImageType.RGB); ImageIO.write(bim, "png", os); divs.add("
"); } From 1b7ee09e53b59ddf31d4fdade94edc63f1a8787b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ce=C4=BEuch?= Date: Wed, 12 Jun 2024 20:11:24 +0200 Subject: [PATCH 3/5] visualize rendered pdf in javafx images and add dpi to settings --- .../slovensko/autogram/core/Autogram.java | 2 +- .../slovensko/autogram/core/UserSettings.java | 11 +++++ .../DocumentVisualizationBuilder.java | 12 ++--- .../core/visualization/PDFVisualization.java | 28 ++++------- .../slovensko/autogram/ui/Visualizer.java | 2 +- .../ui/gui/SettingsDialogController.java | 11 +++++ .../ui/gui/SigningDialogController.java | 32 ++++++++----- .../slovensko/autogram/ui/gui/idsk.css | 12 +++++ .../autogram/ui/gui/settings-dialog.fxml | 17 +++++++ .../autogram/ui/gui/signing-dialog.fxml | 7 ++- .../autogram/ui/gui/visualization-pdf.html | 48 ------------------- .../slovensko/autogram/SigningJobTests.java | 2 +- .../autogram/TransformationTests.java | 4 +- 13 files changed, 98 insertions(+), 90 deletions(-) delete mode 100644 src/main/resources/digital/slovensko/autogram/ui/gui/visualization-pdf.html diff --git a/src/main/java/digital/slovensko/autogram/core/Autogram.java b/src/main/java/digital/slovensko/autogram/core/Autogram.java index 842d9b8d4..4830c107c 100644 --- a/src/main/java/digital/slovensko/autogram/core/Autogram.java +++ b/src/main/java/digital/slovensko/autogram/core/Autogram.java @@ -73,7 +73,7 @@ public void startVisualization(SigningJob job) { } try { - var visualization = DocumentVisualizationBuilder.fromJob(job); + var visualization = DocumentVisualizationBuilder.fromJob(job, settings.getPdfDpi()); ui.onUIThreadDo(() -> ui.showVisualization(visualization, this)); } catch (AutogramException e) { ui.onUIThreadDo(() -> ui.showError(e)); diff --git a/src/main/java/digital/slovensko/autogram/core/UserSettings.java b/src/main/java/digital/slovensko/autogram/core/UserSettings.java index d9fefb9b6..580c3e80f 100644 --- a/src/main/java/digital/slovensko/autogram/core/UserSettings.java +++ b/src/main/java/digital/slovensko/autogram/core/UserSettings.java @@ -29,6 +29,7 @@ public class UserSettings implements PasswordManagerSettings, SignatureTokenSett private boolean tsaEnabled; private String customTsaServer; private boolean bulkEnabled; + private int pdfDpi; public static UserSettings load() { var prefs = Preferences.userNodeForPackage(UserSettings.class); @@ -51,6 +52,7 @@ public static UserSettings load() { settings.setTsaServer(prefs.get("TSA_SERVER", "http://tsa.izenpe.com")); settings.setCustomTsaServer(prefs.get("CUSTOM_TSA_SERVER", "")); settings.setTsaEnabled(prefs.getBoolean("TSA_ENABLE", false)); + settings.setPdfDpi(prefs.getInt("PDF_DPI", 100)); return settings; } @@ -75,6 +77,7 @@ public void save() { prefs.put("TSA_SERVER", tsaServer); prefs.put("CUSTOM_TSA_SERVER", customTsaServer); prefs.putBoolean("TSA_ENABLE", tsaEnabled); + prefs.putInt("PDF_DPI", pdfDpi); } private void setSignatureType(String signatureType) { @@ -260,4 +263,12 @@ public DriverDetector getDriverDetector() { public boolean isBulkEnabled() { return bulkEnabled; } + + public int getPdfDpi() { + return pdfDpi; + } + + public void setPdfDpi(int value) { + pdfDpi = value; + } } diff --git a/src/main/java/digital/slovensko/autogram/core/visualization/DocumentVisualizationBuilder.java b/src/main/java/digital/slovensko/autogram/core/visualization/DocumentVisualizationBuilder.java index 1eeb64f02..39600472d 100644 --- a/src/main/java/digital/slovensko/autogram/core/visualization/DocumentVisualizationBuilder.java +++ b/src/main/java/digital/slovensko/autogram/core/visualization/DocumentVisualizationBuilder.java @@ -29,15 +29,15 @@ private DocumentVisualizationBuilder(DSSDocument document, SigningParameters par this.parameters = parameters; } - public static Visualization fromJob(SigningJob job) throws IOException, ParserConfigurationException, SAXException { - return new DocumentVisualizationBuilder(job.getDocument(), job.getParameters()).build(job); + public static Visualization fromJob(SigningJob job, int pdfDpi) throws IOException, ParserConfigurationException, SAXException { + return new DocumentVisualizationBuilder(job.getDocument(), job.getParameters()).build(job, pdfDpi); } - private Visualization build(SigningJob job) throws IOException, ParserConfigurationException, SAXException { - return createVisualization(job); + private Visualization build(SigningJob job, int pdfDpi) throws IOException, ParserConfigurationException, SAXException { + return createVisualization(job, pdfDpi); } - private Visualization createVisualization(SigningJob job) + private Visualization createVisualization(SigningJob job, int pdfDpi) throws IOException, ParserConfigurationException, SAXException { var documentToDisplay = document; @@ -70,7 +70,7 @@ private Visualization createVisualization(SigningJob job) return new PlainTextVisualization(new String(documentToDisplay.openStream().readAllBytes(), StandardCharsets.UTF_8), job); if (documentToDisplay.getMimeType().equals(MimeTypeEnum.PDF)) - return new PDFVisualization(documentToDisplay, job); + return new PDFVisualization(documentToDisplay, job, pdfDpi); if (documentToDisplay.getMimeType().equals(MimeTypeEnum.JPEG) || documentToDisplay.getMimeType().equals(MimeTypeEnum.PNG)) return new ImageVisualization(documentToDisplay, job); diff --git a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java index b754a4044..92bea333f 100644 --- a/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java +++ b/src/main/java/digital/slovensko/autogram/core/visualization/PDFVisualization.java @@ -1,15 +1,10 @@ package digital.slovensko.autogram.core.visualization; -import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Base64; -import digital.slovensko.autogram.core.FailedVisualizationException; import digital.slovensko.autogram.core.SigningJob; -import digital.slovensko.autogram.core.errors.AutogramException; import digital.slovensko.autogram.ui.Visualizer; import eu.europa.esig.dss.model.DSSDocument; import org.apache.pdfbox.pdmodel.PDDocument; @@ -20,29 +15,24 @@ public class PDFVisualization extends Visualization { private final DSSDocument document; + private final int pdfDpi; - public PDFVisualization(DSSDocument document, SigningJob job) { + + public PDFVisualization(DSSDocument document, SigningJob job, int pdfDpi) { super(job); this.document = document; + this.pdfDpi = pdfDpi; } - private String getBase64EncodedDocument() { - try (var is = document.openStream()) { - return new String(Base64.getEncoder().encode(is.readAllBytes()), StandardCharsets.UTF_8); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - private ArrayList getHTML() throws IOException { + private ArrayList getPdfImages() throws IOException { var pdfDocument = PDDocument.load(this.document.openStream()); var pdfRenderer = new PDFRenderer(pdfDocument); - var divs = new ArrayList(); + var divs = new ArrayList(); for (int page = 0; page < pdfDocument.getNumberOfPages(); ++page) { var os = new ByteArrayOutputStream(); - var bim = pdfRenderer.renderImageWithDPI(page, 100, ImageType.RGB); + var bim = pdfRenderer.renderImageWithDPI(page, pdfDpi, ImageType.RGB); ImageIO.write(bim, "png", os); - divs.add("
"); + divs.add(os.toByteArray()); } pdfDocument.close(); @@ -53,6 +43,6 @@ private ArrayList getHTML() throws IOException { @Override public void initialize(Visualizer visualizer) throws IOException { visualizer.setPrefWidth(getVisualizationWidth()); - visualizer.showPDFVisualization(getHTML()); + visualizer.showPDFVisualization(getPdfImages()); } } \ No newline at end of file diff --git a/src/main/java/digital/slovensko/autogram/ui/Visualizer.java b/src/main/java/digital/slovensko/autogram/ui/Visualizer.java index 946847351..06c5cb600 100644 --- a/src/main/java/digital/slovensko/autogram/ui/Visualizer.java +++ b/src/main/java/digital/slovensko/autogram/ui/Visualizer.java @@ -7,7 +7,7 @@ public interface Visualizer { void showUnsupportedVisualization(); - void showPDFVisualization(ArrayList base64EncodedDocument); + void showPDFVisualization(ArrayList base64EncodedDocument); void showHTMLVisualization(String document); diff --git a/src/main/java/digital/slovensko/autogram/ui/gui/SettingsDialogController.java b/src/main/java/digital/slovensko/autogram/ui/gui/SettingsDialogController.java index be9f3a456..212efd595 100644 --- a/src/main/java/digital/slovensko/autogram/ui/gui/SettingsDialogController.java +++ b/src/main/java/digital/slovensko/autogram/ui/gui/SettingsDialogController.java @@ -47,6 +47,8 @@ public class SettingsDialogController { @FXML private HBox localServerEnabledRadios; @FXML + private ChoiceBox pdfDpiChoiceBox; + @FXML private ChoiceBox slotIndexChoiceBox; @FXML private TextField customKeystorePathTextField; @@ -81,6 +83,7 @@ public void initialize() { initializeLocalServerEnabledCheckBox(); initializeTrustedCountriesList(); initializeSlotIndexSettings(); + initializePdfDpiSettings(); initializeCustomKeystoreSettings(); } @@ -277,6 +280,14 @@ private void initializeSlotIndexSettings() { }); } + private void initializePdfDpiSettings() { + pdfDpiChoiceBox.getItems().addAll("50 dpi", "70 dpi", "100 dpi", "150 dpi", "200 dpi", "300 dpi"); + pdfDpiChoiceBox.setValue(String.valueOf(userSettings.getPdfDpi()) + " dpi"); + pdfDpiChoiceBox.getSelectionModel().selectedItemProperty() + .addListener((observable, oldValue, newValue) -> + userSettings.setPdfDpi(Integer.parseInt(newValue.replace(" dpi", "")))); + } + private void initializeCustomKeystoreSettings() { customKeystorePathTextField.setText(userSettings.getCustomKeystorePath()); customKeystorePathTextField.setOnKeyTyped((e) -> { diff --git a/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java b/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java index 15f00653d..229fa5447 100644 --- a/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java +++ b/src/main/java/digital/slovensko/autogram/ui/gui/SigningDialogController.java @@ -2,6 +2,7 @@ import digital.slovensko.autogram.core.Autogram; import digital.slovensko.autogram.core.SignatureValidator; +import digital.slovensko.autogram.core.visualization.ImageVisualization; import digital.slovensko.autogram.core.visualization.Visualization; import digital.slovensko.autogram.ui.Visualizer; import digital.slovensko.autogram.util.DSSUtils; @@ -20,12 +21,15 @@ import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.ContextMenuEvent; +import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.web.WebView; import javafx.stage.Modality; import javafx.stage.Stage; +import org.verapdf.xmp.impl.Base64; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; @@ -53,6 +57,10 @@ public class SigningDialogController implements SuppressedFocusController, Visua @FXML VBox webViewContainer; @FXML + ScrollPane pdfVisualizationContainer; + @FXML + VBox pdfVisualizationBox; + @FXML ImageView imageVisualization; @FXML ScrollPane imageVisualizationContainer; @@ -301,18 +309,20 @@ public void showHTMLVisualization(String html) { webViewContainer.setManaged(true); } - public void showPDFVisualization(ArrayList data) { - var engine = webView.getEngine(); - engine.setJavaScriptEnabled(true); - engine.getLoadWorker().stateProperty().addListener((observable, oldState, newState) -> { - if (newState == Worker.State.SUCCEEDED) { - engine.executeScript("displayPdf(['" + String.join("', '", data) + "'])"); - } + public void showPDFVisualization(ArrayList data) { + data.forEach(page -> { + var imgView = new ImageView(); + imgView.fitWidthProperty().bind(pdfVisualizationContainer.widthProperty().subtract(30)); + imgView.setImage(new Image(new ByteArrayInputStream(page))); + imgView.setPreserveRatio(true); + imgView.setSmooth(true); + + pdfVisualizationBox.getChildren().add(new HBox(imgView)); }); - engine.load(getClass().getResource("visualization-pdf.html").toExternalForm()); - webViewContainer.getStyleClass().add("autogram-visualizer-pdf"); - webViewContainer.setVisible(true); - webViewContainer.setManaged(true); + + pdfVisualizationContainer.setFitToWidth(true); + pdfVisualizationContainer.setVisible(true); + pdfVisualizationContainer.setManaged(true); } public void showImageVisualization(DSSDocument doc) { diff --git a/src/main/resources/digital/slovensko/autogram/ui/gui/idsk.css b/src/main/resources/digital/slovensko/autogram/ui/gui/idsk.css index b37000d03..f6ac0f10a 100644 --- a/src/main/resources/digital/slovensko/autogram/ui/gui/idsk.css +++ b/src/main/resources/digital/slovensko/autogram/ui/gui/idsk.css @@ -447,6 +447,7 @@ .autogram-visualizer-plaintext, .autogram-visualizer-html, +.autogram-visualizer-pdf, .autogram-visualizer-image { -fx-border-color: -autogram-input-border-colour; -fx-border-width: 2px; @@ -454,6 +455,17 @@ -fx-wrap-text: true; } +.autogram-visualizer-pdf VBox { + -fx-spacing: 8px; + -fx-padding: 4px; +} + +.autogram-visualizer-pdf VBox > HBox { + -fx-border-color: -autogram-input-border-colour; + -fx-border-width: 1px; + -fx-border-style: solid; +} + .autogram-visualizer-plaintext { -fx-padding: 5px; } diff --git a/src/main/resources/digital/slovensko/autogram/ui/gui/settings-dialog.fxml b/src/main/resources/digital/slovensko/autogram/ui/gui/settings-dialog.fxml index b0d0a9d62..1f0b41041 100644 --- a/src/main/resources/digital/slovensko/autogram/ui/gui/settings-dialog.fxml +++ b/src/main/resources/digital/slovensko/autogram/ui/gui/settings-dialog.fxml @@ -336,6 +336,23 @@ styleClass="autogram-smaller-radio-buttons" /> + + + + + Rozlíšenie náhľadu PDF + + + + + Vyššie DPI môže pri veľkých PDF dokumentoch spôsobovať výrazne pomalé zobrazenie. Naopak pri nízkom DPI je zobrazenie rýchlejšie, no dokument je viac rozmazaný. + + + + + + + diff --git a/src/main/resources/digital/slovensko/autogram/ui/gui/signing-dialog.fxml b/src/main/resources/digital/slovensko/autogram/ui/gui/signing-dialog.fxml index c7f94bc73..2b4b8ac73 100644 --- a/src/main/resources/digital/slovensko/autogram/ui/gui/signing-dialog.fxml +++ b/src/main/resources/digital/slovensko/autogram/ui/gui/signing-dialog.fxml @@ -21,11 +21,16 @@ - + + + + + +