From 9697d1abe1dd81719f0e862512391da931ee9514 Mon Sep 17 00:00:00 2001 From: "stirlingbot[bot]" <195170888+stirlingbot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:43:28 +0100 Subject: [PATCH 1/5] :globe_with_meridians: Sync Translations + Update README Progress Table (#3635) ### Description of Changes This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made: #### **1. Synchronization of Translation Files** - Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`. - Ensured consistency and synchronization across all supported language files. - Highlighted any missing or incomplete translations. #### **2. Update README.md** - Generated the translation progress table in `README.md`. - Added a summary of the current translation status for all supported languages. - Included up-to-date statistics on translation coverage. #### **Why these changes are necessary** - Keeps translation files aligned with the latest reference updates. - Ensures the documentation reflects the current translation progress. --- Auto-generated by [create-pull-request][1]. [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36d600787..c37f499f1 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Stirling-PDF currently supports 40 languages! | Hungarian (Magyar) (hu_HU) | ![87%](https://geps.dev/progress/87) | | Indonesian (Bahasa Indonesia) (id_ID) | ![74%](https://geps.dev/progress/74) | | Irish (Gaeilge) (ga_IE) | ![81%](https://geps.dev/progress/81) | -| Italian (Italiano) (it_IT) | ![95%](https://geps.dev/progress/95) | +| Italian (Italiano) (it_IT) | ![98%](https://geps.dev/progress/98) | | Japanese (日本語) (ja_JP) | ![82%](https://geps.dev/progress/82) | | Korean (한국어) (ko_KR) | ![80%](https://geps.dev/progress/80) | | Norwegian (Norsk) (no_NB) | ![78%](https://geps.dev/progress/78) | From a8c6a8342c66942ab728fd909d5b04a29e621687 Mon Sep 17 00:00:00 2001 From: Ludy Date: Tue, 3 Jun 2025 18:43:51 +0200 Subject: [PATCH 2/5] Update messages_de_DE.properties (#3618) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main/resources/messages_de_DE.properties | 266 +++++++++---------- 1 file changed, 133 insertions(+), 133 deletions(-) diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index c9744c87a..1291e8666 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -6,133 +6,133 @@ language.direction=ltr # Language names for reuse throughout the application lang.afr=Afrikaans -lang.amh=Amharic -lang.ara=Arabic -lang.asm=Assamese -lang.aze=Azerbaijani -lang.aze_cyrl=Azerbaijani (Cyrillic) -lang.bel=Belarusian -lang.ben=Bengali -lang.bod=Tibetan -lang.bos=Bosnian -lang.bre=Breton -lang.bul=Bulgarian -lang.cat=Catalan +lang.amh=Amharisch +lang.ara=Arabisch +lang.asm=Assamesisch +lang.aze=Aserbaidschanisch +lang.aze_cyrl=Aserbaidschanisch (Kyrillisch) +lang.bel=Weißrussisch +lang.ben=Bengalisch +lang.bod=Tibetisch +lang.bos=Bosnisch +lang.bre=Bretonisch +lang.bul=Bulgarisch +lang.cat=Katalanisch lang.ceb=Cebuano -lang.ces=Czech -lang.chi_sim=Chinese (Simplified) -lang.chi_sim_vert=Chinese (Simplified, Vertical) -lang.chi_tra=Chinese (Traditional) -lang.chi_tra_vert=Chinese (Traditional, Vertical) +lang.ces=Tschechisch +lang.chi_sim=Chinesisch (vereinfacht) +lang.chi_sim_vert=Chinesisch (vereinfacht, vertikal) +lang.chi_tra=Chinesisch (traditionell) +lang.chi_tra_vert=Chinesisch (traditionell, vertikal) lang.chr=Cherokee -lang.cos=Corsican -lang.cym=Welsh -lang.dan=Danish -lang.dan_frak=Danish (Fraktur) -lang.deu=German -lang.deu_frak=German (Fraktur) +lang.cos=Korsisch +lang.cym=Walisisch +lang.dan=Dänisch +lang.dan_frak=Dänisch (Fraktur) +lang.deu=Deutsch +lang.deu_frak=Deutsch (Fraktur) lang.div=Divehi lang.dzo=Dzongkha -lang.ell=Greek -lang.eng=English -lang.enm=English, Middle (1100-1500) +lang.ell=Griechisch +lang.eng=Englisch +lang.enm=Englisch, Mittelenglisch (1100-1500) lang.epo=Esperanto -lang.equ=Math / equation detection module -lang.est=Estonian -lang.eus=Basque -lang.fao=Faroese -lang.fas=Persian -lang.fil=Filipino -lang.fin=Finnish -lang.fra=French -lang.frk=Frankish -lang.frm=French, Middle (ca.1400-1600) -lang.fry=Western Frisian -lang.gla=Scottish Gaelic -lang.gle=Irish -lang.glg=Galician -lang.grc=Ancient Greek +lang.equ=Mathe-/Gleichungserkennungsmodul +lang.est=Estnisch +lang.eus=Baskisch +lang.fao=Färöisch +lang.fas=Persisch +lang.fil=Philippinisch +lang.fin=Finnisch +lang.fra=Französisch +lang.frk=Fränkisch +lang.frm=Französisch, Mittelfranzösisch (ca. 1400-1600) +lang.fry=Westfriesisch +lang.gla=Schottisch-Gälisch +lang.gle=Irisch +lang.glg=Galizisch +lang.grc=Altgriechisch lang.guj=Gujarati -lang.hat=Haitian, Haitian Creole -lang.heb=Hebrew +lang.hat=Haitianisch, haitianisches Kreol +lang.heb=Hebräisch lang.hin=Hindi -lang.hrv=Croatian -lang.hun=Hungarian -lang.hye=Armenian +lang.hrv=Kroatisch +lang.hun=Ungarisch +lang.hye=Armenisch lang.iku=Inuktitut -lang.ind=Indonesian -lang.isl=Icelandic -lang.ita=Italian -lang.ita_old=Italian (Old) -lang.jav=Javanese -lang.jpn=Japanese -lang.jpn_vert=Japanese (Vertical) +lang.ind=Indonesisch +lang.isl=Isländisch +lang.ita=Italienisch +lang.ita_old=Italienisch (Alt) +lang.jav=Javanesisch +lang.jpn=Japanisch +lang.jpn_vert=Japanisch (vertikal) lang.kan=Kannada -lang.kat=Georgian -lang.kat_old=Georgian (Old) -lang.kaz=Kazakh -lang.khm=Central Khmer -lang.kir=Kirghiz, Kyrgyz -lang.kmr=Northern Kurdish -lang.kor=Korean -lang.kor_vert=Korean (Vertical) -lang.lao=Lao -lang.lat=Latin -lang.lav=Latvian -lang.lit=Lithuanian -lang.ltz=Luxembourgish +lang.kat=Georgisch +lang.kat_old=Georgisch (Alt) +lang.kaz=Kasachisch +lang.khm=Zentral Khmer +lang.kir=Kirgisisch +lang.kmr=Nordkurdisch +lang.kor=Koreanisch +lang.kor_vert=Koreanisch (vertikal) +lang.lao=Laotisch +lang.lat=Latein +lang.lav=Lettisch +lang.lit=Litauisch +lang.ltz=Luxemburgisch lang.mal=Malayalam lang.mar=Marathi -lang.mkd=Macedonian -lang.mlt=Maltese -lang.mon=Mongolian +lang.mkd=Mazedonisch +lang.mlt=Maltesisch +lang.mon=Mongolisch lang.mri=Maori -lang.msa=Malay -lang.mya=Burmese +lang.msa=Malaiisch +lang.mya=Burmesisch lang.nep=Nepali -lang.nld=Dutch; Flemish -lang.nor=Norwegian -lang.oci=Occitan (post 1500) +lang.nld=Niederländisch; Flämisch +lang.nor=Norwegisch +lang.oci=Okzitanisch (nach 1500) lang.ori=Oriya -lang.osd=Orientation and script detection module +lang.osd=Orientierungs- und Skripterkennungsmodul lang.pan=Panjabi, Punjabi -lang.pol=Polish -lang.por=Portuguese -lang.pus=Pushto, Pashto +lang.pol=Polnisch +lang.por=Portugiesisch +lang.pus=Puschtu, Paschtu lang.que=Quechua -lang.ron=Romanian, Moldavian, Moldovan -lang.rus=Russian +lang.ron=Rumänisch, Moldauisch, Moldauisch +lang.rus=Russisch lang.san=Sanskrit -lang.sin=Sinhala, Sinhalese -lang.slk=Slovak -lang.slk_frak=Slovak (Fraktur) -lang.slv=Slovenian +lang.sin=Singhalesisch +lang.slk=Slowakisch +lang.slk_frak=Slowakisch (Fraktur) +lang.slv=Slowenisch lang.snd=Sindhi -lang.spa=Spanish -lang.spa_old=Spanish (Old) -lang.sqi=Albanian -lang.srp=Serbian -lang.srp_latn=Serbian (Latin) -lang.sun=Sundanese -lang.swa=Swahili -lang.swe=Swedish -lang.syr=Syriac +lang.spa=Spanisch +lang.spa_old=Spanisch (Alt) +lang.sqi=Albanisch +lang.srp=Serbisch +lang.srp_latn=Serbisch (Lateinisch) +lang.sun=Sundanesisch +lang.swa=Suaheli +lang.swe=Schwedisch +lang.syr=Syrisch lang.tam=Tamil -lang.tat=Tatar +lang.tat=Tatarisch lang.tel=Telugu -lang.tgk=Tajik +lang.tgk=Tadschikisch lang.tgl=Tagalog -lang.tha=Thai +lang.tha=Thailändisch lang.tir=Tigrinya -lang.ton=Tonga (Tonga Islands) -lang.tur=Turkish -lang.uig=Uighur, Uyghur -lang.ukr=Ukrainian +lang.ton=Tonga (Tonga-Inseln) +lang.tur=Türkisch +lang.uig=Uigurisch +lang.ukr=Ukrainisch lang.urd=Urdu -lang.uzb=Uzbek -lang.uzb_cyrl=Uzbek (Cyrillic) -lang.vie=Vietnamese -lang.yid=Yiddish +lang.uzb=Usbekisch +lang.uzb_cyrl=Usbekisch (Kyrillisch) +lang.vie=Vietnamesisch +lang.yid=Jiddisch lang.yor=Yoruba addPageNumbers.fontSize=Schriftgröße @@ -1570,37 +1570,37 @@ cookieBanner.preferencesModal.analytics.title=Analyse cookieBanner.preferencesModal.analytics.description=Diese Cookies helfen uns zu verstehen, wie unsere Tools genutzt werden, damit wir uns darauf konzentrieren können, die Funktionen zu entwickeln, die unserer Community am meisten am Herzen liegen. Seien Sie beruhigt – Stirling PDF kann und wird niemals den Inhalt der Dokumente verfolgen, mit denen Sie arbeiten. #fakeScan -fakeScan.title=Fake Scan -fakeScan.header=Fake Scan -fakeScan.description=Create a PDF that looks like it was scanned -fakeScan.selectPDF=Select PDF: -fakeScan.quality=Scan Quality -fakeScan.quality.low=Low +fakeScan.title=Fake-Scan-PDF +fakeScan.header=Fake-Scan-PDF +fakeScan.description=Erstellen Sie ein PDF, das so aussieht, als wäre es gescannt worden +fakeScan.selectPDF=Wählen Sie PDF: +fakeScan.quality=Scan-Qualität +fakeScan.quality.low=Niedrig fakeScan.quality.medium=Medium -fakeScan.quality.high=High -fakeScan.rotation=Rotation Angle -fakeScan.rotation.none=None -fakeScan.rotation.slight=Slight -fakeScan.rotation.moderate=Moderate -fakeScan.rotation.severe=Severe -fakeScan.submit=Create Fake Scan +fakeScan.quality.high=Hoch +fakeScan.rotation=Rotationswinkel +fakeScan.rotation.none=Keiner +fakeScan.rotation.slight=Leicht +fakeScan.rotation.moderate=Mäßig +fakeScan.rotation.severe=Schwer +fakeScan.submit=Erstellen Sie einen Fake-Scan #home.fakeScan -home.fakeScan.title=Fake Scan -home.fakeScan.desc=Create a PDF that looks like it was scanned -fakeScan.tags=scan,simulate,realistic,convert +home.fakeScan.title=Fake-Scan-PDF +home.fakeScan.desc=Erstellen Sie ein PDF, das so aussieht, als wäre es gescannt worden +fakeScan.tags=scannen,simulieren,realistisch,konvertieren,fake,scan,pdf # FakeScan advanced settings (frontend) -fakeScan.advancedSettings=Enable Advanced Scan Settings -fakeScan.colorspace=Colorspace -fakeScan.colorspace.grayscale=Grayscale -fakeScan.colorspace.color=Color -fakeScan.border=Border (px) -fakeScan.rotate=Base Rotation (degrees) -fakeScan.rotateVariance=Rotation Variance (degrees) -fakeScan.brightness=Brightness -fakeScan.contrast=Contrast -fakeScan.blur=Blur -fakeScan.noise=Noise -fakeScan.yellowish=Yellowish (simulate old paper) -fakeScan.resolution=Resolution (DPI) +fakeScan.advancedSettings=Aktivieren Sie erweiterte Scaneinstellungen +fakeScan.colorspace=Farbraum +fakeScan.colorspace.grayscale=Graustufen +fakeScan.colorspace.color=Farbe +fakeScan.border=Grenze (PX) +fakeScan.rotate=Grundrotation (Grad) +fakeScan.rotateVariance=Rotationsvarianz (Grad) +fakeScan.brightness=Helligkeit +fakeScan.contrast=Kontrast +fakeScan.blur=Verwischen +fakeScan.noise=Rauschen +fakeScan.yellowish=Gelblich (simulieren Sie altes Papier) +fakeScan.resolution=Auflösung (DPI) From 5d9d8a5625248286ca10c3d629cc1cb13b56d3cb Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:44:35 +0100 Subject: [PATCH 3/5] Fix error display for Split by Chapter (#3621) ## Summary - throw `IllegalArgumentException` when bookmark level is invalid or when a PDF has no outline - rely on global error handling so frontend shows the message ## Testing - `./gradlew build` ------ https://chatgpt.com/codex/tasks/task_b_683dc51dd31083288be3f9892889fa59 --- .../SPDF/controller/api/SplitPdfByChaptersController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/controller/api/SplitPdfByChaptersController.java b/src/main/java/stirling/software/SPDF/controller/api/SplitPdfByChaptersController.java index 80ec89738..94cf6aa6d 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/SplitPdfByChaptersController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/SplitPdfByChaptersController.java @@ -131,7 +131,7 @@ public class SplitPdfByChaptersController { Integer bookmarkLevel = request.getBookmarkLevel(); // levels start from 0 (top most bookmarks) if (bookmarkLevel < 0) { - return ResponseEntity.badRequest().body("Invalid bookmark level".getBytes()); + throw new IllegalArgumentException("Invalid bookmark level"); } sourceDocument = pdfDocumentFactory.load(file); @@ -139,7 +139,7 @@ public class SplitPdfByChaptersController { if (outline == null) { log.warn("No outline found for {}", file.getOriginalFilename()); - return ResponseEntity.badRequest().body("No outline found".getBytes()); + throw new IllegalArgumentException("No outline found"); } List bookmarks = new ArrayList<>(); try { From 9cc4f14465c4ea08b50fba04946d9ba6b18234ea Mon Sep 17 00:00:00 2001 From: "stirlingbot[bot]" <195170888+stirlingbot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:46:14 +0100 Subject: [PATCH 4/5] :globe_with_meridians: Sync Translations + Update README Progress Table (#3638) ### Description of Changes This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made: #### **1. Synchronization of Translation Files** - Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`. - Ensured consistency and synchronization across all supported language files. - Highlighted any missing or incomplete translations. #### **2. Update README.md** - Generated the translation progress table in `README.md`. - Added a summary of the current translation status for all supported languages. - Included up-to-date statistics on translation coverage. #### **Why these changes are necessary** - Keeps translation files aligned with the latest reference updates. - Ensures the documentation reflects the current translation progress. --- Auto-generated by [create-pull-request][1]. [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c37f499f1..58659da26 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Stirling-PDF currently supports 40 languages! | English (English) (en_GB) | ![100%](https://geps.dev/progress/100) | | English (US) (en_US) | ![100%](https://geps.dev/progress/100) | | French (Français) (fr_FR) | ![82%](https://geps.dev/progress/82) | -| German (Deutsch) (de_DE) | ![89%](https://geps.dev/progress/89) | +| German (Deutsch) (de_DE) | ![99%](https://geps.dev/progress/99) | | Greek (Ελληνικά) (el_GR) | ![80%](https://geps.dev/progress/80) | | Hindi (हिंदी) (hi_IN) | ![80%](https://geps.dev/progress/80) | | Hungarian (Magyar) (hu_HU) | ![87%](https://geps.dev/progress/87) | From 28a259ec95adb5bd483a8d379ea99717ba9b325a Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:48:17 +0100 Subject: [PATCH 5/5] GetInfo summary #2388 (#3585) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. Co-authored-by: a --- .gitignore | 1 + .../controller/api/security/GetInfoOnPDF.java | 59 +++ src/main/resources/messages_en_GB.properties | 22 + .../templates/security/get-info-on-pdf.html | 443 +++++++++++++++++- 4 files changed, 522 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 90d48ccea..06602d03b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ local.properties .recommenders .classpath .project +*.local.json version.properties #### Stirling-PDF Files ### diff --git a/src/main/java/stirling/software/SPDF/controller/api/security/GetInfoOnPDF.java b/src/main/java/stirling/software/SPDF/controller/api/security/GetInfoOnPDF.java index 79ffae74f..c630106e4 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/security/GetInfoOnPDF.java +++ b/src/main/java/stirling/software/SPDF/controller/api/security/GetInfoOnPDF.java @@ -91,6 +91,59 @@ public class GetInfoOnPDF { } } + /** + * Generates structured summary data about the PDF highlighting its unique characteristics such + * as encryption status, permission restrictions, and standards compliance. + * + * @param document The PDF document to analyze + * @return An ObjectNode containing structured summary data + */ + private ObjectNode generatePDFSummaryData(PDDocument document) { + ObjectNode summaryData = objectMapper.createObjectNode(); + + // Check if encrypted + if (document.isEncrypted()) { + summaryData.put("encrypted", true); + } + + // Check permissions + AccessPermission ap = document.getCurrentAccessPermission(); + ArrayNode restrictedPermissions = objectMapper.createArrayNode(); + + if (!ap.canAssembleDocument()) restrictedPermissions.add("document assembly"); + if (!ap.canExtractContent()) restrictedPermissions.add("content extraction"); + if (!ap.canExtractForAccessibility()) restrictedPermissions.add("accessibility extraction"); + if (!ap.canFillInForm()) restrictedPermissions.add("form filling"); + if (!ap.canModify()) restrictedPermissions.add("modification"); + if (!ap.canModifyAnnotations()) restrictedPermissions.add("annotation modification"); + if (!ap.canPrint()) restrictedPermissions.add("printing"); + + if (restrictedPermissions.size() > 0) { + summaryData.set("restrictedPermissions", restrictedPermissions); + summaryData.put("restrictedPermissionsCount", restrictedPermissions.size()); + } + + // Check standard compliance + if (checkForStandard(document, "PDF/A")) { + summaryData.put("standardCompliance", "PDF/A"); + summaryData.put("standardPurpose", "long-term archiving"); + } else if (checkForStandard(document, "PDF/X")) { + summaryData.put("standardCompliance", "PDF/X"); + summaryData.put("standardPurpose", "graphic exchange"); + } else if (checkForStandard(document, "PDF/UA")) { + summaryData.put("standardCompliance", "PDF/UA"); + summaryData.put("standardPurpose", "universal accessibility"); + } else if (checkForStandard(document, "PDF/E")) { + summaryData.put("standardCompliance", "PDF/E"); + summaryData.put("standardPurpose", "engineering workflows"); + } else if (checkForStandard(document, "PDF/VT")) { + summaryData.put("standardCompliance", "PDF/VT"); + summaryData.put("standardPurpose", "variable and transactional printing"); + } + + return summaryData; + } + public static boolean checkForStandard(PDDocument document, String standardKeyword) { // Check XMP Metadata try { @@ -191,6 +244,12 @@ public class GetInfoOnPDF { } jsonOutput.set("FormFields", formFieldsNode); + // Generate structured summary data about PDF characteristics + ObjectNode summaryData = generatePDFSummaryData(pdfBoxDoc); + if (summaryData != null && summaryData.size() > 0) { + jsonOutput.set("SummaryData", summaryData); + } + // embeed files TODO size if (catalog.getNames() != null) { PDEmbeddedFilesNameTreeNode efTree = catalog.getNames().getEmbeddedFiles(); diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 56d31e749..b875859b6 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -807,6 +807,28 @@ getPdfInfo.title=Get Info on PDF getPdfInfo.header=Get Info on PDF getPdfInfo.submit=Get Info getPdfInfo.downloadJson=Download JSON +getPdfInfo.summary=PDF Summary +getPdfInfo.summary.encrypted=This PDF is encrypted so may face issues with some applications +getPdfInfo.summary.permissions=This PDF has {0} restricted permissions which may limit what you can do with it +getPdfInfo.summary.compliance=This PDF complies with the {0} standard +getPdfInfo.summary.basicInfo=Basic Information +getPdfInfo.summary.docInfo=Document Information +getPdfInfo.summary.encrypted.alert=Encrypted PDF - This document is password protected +getPdfInfo.summary.not.encrypted.alert=Unencrypted PDF - No password protection +getPdfInfo.summary.permissions.alert=Restricted Permissions - {0} actions are not allowed +getPdfInfo.summary.all.permissions.alert=All Permissions Allowed +getPdfInfo.summary.compliance.alert={0} Compliant +getPdfInfo.summary.no.compliance.alert=No Compliance Standards +getPdfInfo.summary.security.section=Security Status +getPdfInfo.section.BasicInfo=Basic Information about the PDF document including file size, page count, and language +getPdfInfo.section.Metadata=Document metadata including title, author, creation date and other document properties +getPdfInfo.section.DocumentInfo=Technical details about the PDF document structure and version +getPdfInfo.section.Compliancy=PDF standards compliance information (PDF/A, PDF/X, etc.) +getPdfInfo.section.Encryption=Security and encryption details of the document +getPdfInfo.section.Permissions=Document permission settings that control what actions can be performed +getPdfInfo.section.Other=Additional document components like bookmarks, layers, and embedded files +getPdfInfo.section.FormFields=Interactive form fields present in the document +getPdfInfo.section.PerPageInfo=Detailed information about each page in the document #markdown-to-pdf diff --git a/src/main/resources/templates/security/get-info-on-pdf.html b/src/main/resources/templates/security/get-info-on-pdf.html index 97ddf723a..95a5ad391 100644 --- a/src/main/resources/templates/security/get-info-on-pdf.html +++ b/src/main/resources/templates/security/get-info-on-pdf.html @@ -11,7 +11,7 @@

-
+
info @@ -22,6 +22,82 @@
+ + + -