From f95605b9e964bc51991ab524e3c061f2292b1531 Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Wed, 4 Dec 2024 00:08:13 +0530 Subject: [PATCH] Add additional system properties to the extract PDF text (#4384) Co-authored-by: Alexander Ott <45203494+Nirus2000@users.noreply.github.com> --- .../ui/handlers/CreateTextFromPDFHandler.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateTextFromPDFHandler.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateTextFromPDFHandler.java index 65e84c1ed9..50f3d88696 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateTextFromPDFHandler.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateTextFromPDFHandler.java @@ -26,6 +26,7 @@ public class CreateTextFromPDFHandler { + @SuppressWarnings("nls") @Execute public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) throws IOException @@ -47,18 +48,23 @@ public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, inputFile.convertPDFtoText(); StringBuilder textBuilder = new StringBuilder(); - textBuilder.append("```") //$NON-NLS-1$ - .append("\n"); //$NON-NLS-1$ - textBuilder.append("PDFBox Version: ") //$NON-NLS-1$ + textBuilder.append("```").append("\n"); + textBuilder.append("PDFBox Version: ") .append(inputFile.getPDFBoxVersion().toString()) // - .append("\n"); //$NON-NLS-1$ - textBuilder.append("Portfolio Performance Version: ") //$NON-NLS-1$ + .append("\n"); + textBuilder.append("Portfolio Performance Version: ") .append(PortfolioPlugin.getDefault().getBundle().getVersion().toString()) // - .append("\n"); //$NON-NLS-1$ - textBuilder.append("-----------------------------------------\n"); //$NON-NLS-1$ - textBuilder.append(inputFile.getText().replace("\r", "")) //$NON-NLS-1$ //$NON-NLS-2$ - .append("\n"); //$NON-NLS-1$ - textBuilder.append("```"); //$NON-NLS-1$ + .append("\n"); + + textBuilder.append("System: ") // + .append(System.getProperty("osgi.os", "unknown")).append(" | ") + .append(System.getProperty("osgi.arch", "unknown")).append(" | ") + .append(System.getProperty("java.vm.version", "unknown")).append(" | ") + .append(System.getProperty("java.vm.vendor", "unknown")).append("\n"); + + textBuilder.append("-----------------------------------------\n"); + textBuilder.append(inputFile.getText().replace("\r", "")).append("\n"); + textBuilder.append("```"); String text = textBuilder.toString();