diff --git a/stirling-pdf/src/main/resources/messages_ar_AR.properties b/stirling-pdf/src/main/resources/messages_ar_AR.properties index 5232fa0b3..a346519cf 100644 --- a/stirling-pdf/src/main/resources/messages_ar_AR.properties +++ b/stirling-pdf/src/main/resources/messages_ar_AR.properties @@ -471,6 +471,10 @@ home.addImage.title=????? ???? ??? ??? PDF home.addImage.desc=????? ???? ??? ???? ???? ?? PDF (????? ??? ??????) addImage.tags=????,jpg,????,???? ?????????? +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + home.watermark.title=????? ????? ????? home.watermark.desc=??? ????? ????? ????? ??? ????? PDF ????? ??. watermark.tags=??,?????,?????,???,???? ?????,????? ??????,????,jpg,????,???? ?????????? @@ -1642,3 +1646,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_az_AZ.properties b/stirling-pdf/src/main/resources/messages_az_AZ.properties index ec9ba647a..6adf37836 100644 --- a/stirling-pdf/src/main/resources/messages_az_AZ.properties +++ b/stirling-pdf/src/main/resources/messages_az_AZ.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_bg_BG.properties b/stirling-pdf/src/main/resources/messages_bg_BG.properties index 2470e1635..95ee4e102 100644 --- a/stirling-pdf/src/main/resources/messages_bg_BG.properties +++ b/stirling-pdf/src/main/resources/messages_bg_BG.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_bo_CN.properties b/stirling-pdf/src/main/resources/messages_bo_CN.properties index 8306fc4fd..fc82ada75 100644 --- a/stirling-pdf/src/main/resources/messages_bo_CN.properties +++ b/stirling-pdf/src/main/resources/messages_bo_CN.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ca_CA.properties b/stirling-pdf/src/main/resources/messages_ca_CA.properties index 4688194fe..72c4715eb 100644 --- a/stirling-pdf/src/main/resources/messages_ca_CA.properties +++ b/stirling-pdf/src/main/resources/messages_ca_CA.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_cs_CZ.properties b/stirling-pdf/src/main/resources/messages_cs_CZ.properties index 551d2f9a3..921cff8a3 100644 --- a/stirling-pdf/src/main/resources/messages_cs_CZ.properties +++ b/stirling-pdf/src/main/resources/messages_cs_CZ.properties @@ -1642,3 +1642,16 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_da_DK.properties b/stirling-pdf/src/main/resources/messages_da_DK.properties index 1a827fa43..3bd2bb81d 100644 --- a/stirling-pdf/src/main/resources/messages_da_DK.properties +++ b/stirling-pdf/src/main/resources/messages_da_DK.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_de_DE.properties b/stirling-pdf/src/main/resources/messages_de_DE.properties index 68f7a9b85..2ab69291d 100644 --- a/stirling-pdf/src/main/resources/messages_de_DE.properties +++ b/stirling-pdf/src/main/resources/messages_de_DE.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Verwischen fakeScan.noise=Rauschen fakeScan.yellowish=Gelblich (simulieren Sie altes Papier) fakeScan.resolution=Aufl๖sung (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_el_GR.properties b/stirling-pdf/src/main/resources/messages_el_GR.properties index 9c0f5b3f9..a416e3da8 100644 --- a/stirling-pdf/src/main/resources/messages_el_GR.properties +++ b/stirling-pdf/src/main/resources/messages_el_GR.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_es_ES.properties b/stirling-pdf/src/main/resources/messages_es_ES.properties index a08235a93..5f0dcc730 100644 --- a/stirling-pdf/src/main/resources/messages_es_ES.properties +++ b/stirling-pdf/src/main/resources/messages_es_ES.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_eu_ES.properties b/stirling-pdf/src/main/resources/messages_eu_ES.properties index 973b253ca..be7b121d2 100644 --- a/stirling-pdf/src/main/resources/messages_eu_ES.properties +++ b/stirling-pdf/src/main/resources/messages_eu_ES.properties @@ -1642,3 +1642,16 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_fa_IR.properties b/stirling-pdf/src/main/resources/messages_fa_IR.properties index c78fb68cf..64bbe73f8 100644 --- a/stirling-pdf/src/main/resources/messages_fa_IR.properties +++ b/stirling-pdf/src/main/resources/messages_fa_IR.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_fr_FR.properties b/stirling-pdf/src/main/resources/messages_fr_FR.properties index 9d2803ffd..338078711 100644 --- a/stirling-pdf/src/main/resources/messages_fr_FR.properties +++ b/stirling-pdf/src/main/resources/messages_fr_FR.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ga_IE.properties b/stirling-pdf/src/main/resources/messages_ga_IE.properties index 872977fd1..c5abe0e06 100644 --- a/stirling-pdf/src/main/resources/messages_ga_IE.properties +++ b/stirling-pdf/src/main/resources/messages_ga_IE.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_hi_IN.properties b/stirling-pdf/src/main/resources/messages_hi_IN.properties index 7909376f7..18d48be6b 100644 --- a/stirling-pdf/src/main/resources/messages_hi_IN.properties +++ b/stirling-pdf/src/main/resources/messages_hi_IN.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_hr_HR.properties b/stirling-pdf/src/main/resources/messages_hr_HR.properties index 488978f22..8515807cc 100644 --- a/stirling-pdf/src/main/resources/messages_hr_HR.properties +++ b/stirling-pdf/src/main/resources/messages_hr_HR.properties @@ -1642,3 +1642,17 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_hu_HU.properties b/stirling-pdf/src/main/resources/messages_hu_HU.properties index 40f706c99..c1bf29136 100644 --- a/stirling-pdf/src/main/resources/messages_hu_HU.properties +++ b/stirling-pdf/src/main/resources/messages_hu_HU.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Elmos fakeScan.noise=Zaj fakeScan.yellowish=Sแrgแs (r้gi papํr szimulแlแsa) fakeScan.resolution=Felbontแs (DPI) + + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_id_ID.properties b/stirling-pdf/src/main/resources/messages_id_ID.properties index 4d4538afe..e122ab224 100644 --- a/stirling-pdf/src/main/resources/messages_id_ID.properties +++ b/stirling-pdf/src/main/resources/messages_id_ID.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_it_IT.properties b/stirling-pdf/src/main/resources/messages_it_IT.properties index e2c6e3fbc..23254ce2d 100644 --- a/stirling-pdf/src/main/resources/messages_it_IT.properties +++ b/stirling-pdf/src/main/resources/messages_it_IT.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Sfocatura fakeScan.noise=Rumore fakeScan.yellowish=Giallastro (simula carta vecchia) fakeScan.resolution=Risoluzione (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ja_JP.properties b/stirling-pdf/src/main/resources/messages_ja_JP.properties index 8ceb9643e..9c65d4b0f 100644 --- a/stirling-pdf/src/main/resources/messages_ja_JP.properties +++ b/stirling-pdf/src/main/resources/messages_ja_JP.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ko_KR.properties b/stirling-pdf/src/main/resources/messages_ko_KR.properties index f7dfb7bdb..82dc25df9 100644 --- a/stirling-pdf/src/main/resources/messages_ko_KR.properties +++ b/stirling-pdf/src/main/resources/messages_ko_KR.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ml_IN.properties b/stirling-pdf/src/main/resources/messages_ml_IN.properties index 05c689c1b..5bdbdf5c5 100644 --- a/stirling-pdf/src/main/resources/messages_ml_IN.properties +++ b/stirling-pdf/src/main/resources/messages_ml_IN.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ml_ML.properties b/stirling-pdf/src/main/resources/messages_ml_ML.properties index 8c247cf6c..22fa891dd 100644 --- a/stirling-pdf/src/main/resources/messages_ml_ML.properties +++ b/stirling-pdf/src/main/resources/messages_ml_ML.properties @@ -1475,3 +1475,17 @@ cookieBanner.preferencesModal.necessary.description=เดตเต†เดฌเตเดธเตˆเดฑเตเดฑ cookieBanner.preferencesModal.analytics.title=เด…เดจเดฒเดฟเดฑเตเดฑเดฟเด•เตเดธเต cookieBanner.preferencesModal.analytics.description=เดžเด™เตเด™เดณเตเดŸเต† เดŸเต‚เดณเตเด•เตพ เดŽเด™เตเด™เดจเต† เด‰เดชเดฏเต‹เด—เดฟเด•เตเด•เตเดจเตเดจเตเดตเต†เดจเตเดจเต เดฎเดจเดธเตเดธเดฟเดฒเดพเด•เตเด•เดพเตป เดˆ เด•เตเด•เตเด•เดฟเด•เตพ เดžเด™เตเด™เดณเต† เดธเดนเดพเดฏเดฟเด•เตเด•เตเดจเตเดจเต, เด…เดคเดฟเดจเดพเตฝ เดžเด™เตเด™เดณเตเดŸเต† เด•เดฎเตเดฎเตเดฏเต‚เดฃเดฟเดฑเตเดฑเดฟ เดเดฑเตเดฑเดตเตเด‚ เด•เต‚เดŸเตเดคเตฝ เดตเดฟเดฒเดฎเดคเดฟเด•เตเด•เตเดจเตเดจ เดซเต€เดšเตเดšเดฑเตเด•เตพ เดจเดฟเตผเดฎเตเดฎเดฟเด•เตเด•เตเดจเตเดจเดคเดฟเตฝ เดžเด™เตเด™เตพเด•เตเด•เต เดถเตเดฐเดฆเตเดง เด•เต‡เดจเตเดฆเตเดฐเต€เด•เดฐเดฟเด•เตเด•เดพเตป เด•เดดเดฟเดฏเตเด‚. เด‰เดฑเดชเตเดชเดพเด•เตเด•เตเด•โ€”เดธเตเดฑเตเดฑเต†เตผเดฒเดฟเด‚เด—เต PDF-เดจเต เดจเดฟเด™เตเด™เตพ เดชเตเดฐเดตเตผเดคเตเดคเดฟเด•เตเด•เตเดจเตเดจ เดชเตเดฐเดฎเดพเดฃเด™เตเด™เดณเตเดŸเต† เด‰เดณเตเดณเดŸเด•เตเด•เด‚ เดŸเตเดฐเดพเด•เตเด•เต เดšเต†เดฏเตเดฏเดพเตป เด•เดดเดฟเดฏเดฟเดฒเตเดฒ, เด’เดฐเดฟเด•เตเด•เดฒเตเด‚ เด•เดดเดฟเดฏเดฟเดฒเตเดฒ. +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_nl_NL.properties b/stirling-pdf/src/main/resources/messages_nl_NL.properties index afe379e22..d771b053a 100644 --- a/stirling-pdf/src/main/resources/messages_nl_NL.properties +++ b/stirling-pdf/src/main/resources/messages_nl_NL.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_no_NB.properties b/stirling-pdf/src/main/resources/messages_no_NB.properties index 5770c86d5..427d20d28 100644 --- a/stirling-pdf/src/main/resources/messages_no_NB.properties +++ b/stirling-pdf/src/main/resources/messages_no_NB.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_pl_PL.properties b/stirling-pdf/src/main/resources/messages_pl_PL.properties index 0f87e81f5..dc8531bfa 100644 --- a/stirling-pdf/src/main/resources/messages_pl_PL.properties +++ b/stirling-pdf/src/main/resources/messages_pl_PL.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_pt_BR.properties b/stirling-pdf/src/main/resources/messages_pt_BR.properties index df738aca3..2875a72f7 100644 --- a/stirling-pdf/src/main/resources/messages_pt_BR.properties +++ b/stirling-pdf/src/main/resources/messages_pt_BR.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_pt_PT.properties b/stirling-pdf/src/main/resources/messages_pt_PT.properties index 5894f40d4..433b7876a 100644 --- a/stirling-pdf/src/main/resources/messages_pt_PT.properties +++ b/stirling-pdf/src/main/resources/messages_pt_PT.properties @@ -1642,3 +1642,19 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ro_RO.properties b/stirling-pdf/src/main/resources/messages_ro_RO.properties index 6732710a0..a5020955b 100644 --- a/stirling-pdf/src/main/resources/messages_ro_RO.properties +++ b/stirling-pdf/src/main/resources/messages_ro_RO.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_ru_RU.properties b/stirling-pdf/src/main/resources/messages_ru_RU.properties index 5fc5d47ef..772d5568a 100644 --- a/stirling-pdf/src/main/resources/messages_ru_RU.properties +++ b/stirling-pdf/src/main/resources/messages_ru_RU.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_sk_SK.properties b/stirling-pdf/src/main/resources/messages_sk_SK.properties index a0b5d2bc1..4fd382335 100644 --- a/stirling-pdf/src/main/resources/messages_sk_SK.properties +++ b/stirling-pdf/src/main/resources/messages_sk_SK.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_sl_SI.properties b/stirling-pdf/src/main/resources/messages_sl_SI.properties index a2851d975..ffad35728 100644 --- a/stirling-pdf/src/main/resources/messages_sl_SI.properties +++ b/stirling-pdf/src/main/resources/messages_sl_SI.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_sr_LATN_RS.properties b/stirling-pdf/src/main/resources/messages_sr_LATN_RS.properties index ed695800b..be85e1140 100644 --- a/stirling-pdf/src/main/resources/messages_sr_LATN_RS.properties +++ b/stirling-pdf/src/main/resources/messages_sr_LATN_RS.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_sv_SE.properties b/stirling-pdf/src/main/resources/messages_sv_SE.properties index fe8733bb4..28210f93c 100644 --- a/stirling-pdf/src/main/resources/messages_sv_SE.properties +++ b/stirling-pdf/src/main/resources/messages_sv_SE.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_th_TH.properties b/stirling-pdf/src/main/resources/messages_th_TH.properties index c949d1f35..84e0acbf1 100644 --- a/stirling-pdf/src/main/resources/messages_th_TH.properties +++ b/stirling-pdf/src/main/resources/messages_th_TH.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_tr_TR.properties b/stirling-pdf/src/main/resources/messages_tr_TR.properties index ecc49fa54..97c970148 100644 --- a/stirling-pdf/src/main/resources/messages_tr_TR.properties +++ b/stirling-pdf/src/main/resources/messages_tr_TR.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_uk_UA.properties b/stirling-pdf/src/main/resources/messages_uk_UA.properties index 3826d516f..b9d7457ea 100644 --- a/stirling-pdf/src/main/resources/messages_uk_UA.properties +++ b/stirling-pdf/src/main/resources/messages_uk_UA.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_vi_VN.properties b/stirling-pdf/src/main/resources/messages_vi_VN.properties index f95d16825..4a4974ef8 100644 --- a/stirling-pdf/src/main/resources/messages_vi_VN.properties +++ b/stirling-pdf/src/main/resources/messages_vi_VN.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_zh_CN.properties b/stirling-pdf/src/main/resources/messages_zh_CN.properties index cb8cc8220..0df8d0d99 100644 --- a/stirling-pdf/src/main/resources/messages_zh_CN.properties +++ b/stirling-pdf/src/main/resources/messages_zh_CN.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/main/resources/messages_zh_TW.properties b/stirling-pdf/src/main/resources/messages_zh_TW.properties index 514846363..decf63517 100644 --- a/stirling-pdf/src/main/resources/messages_zh_TW.properties +++ b/stirling-pdf/src/main/resources/messages_zh_TW.properties @@ -1642,3 +1642,18 @@ fakeScan.blur=Blur fakeScan.noise=Noise fakeScan.yellowish=Yellowish (simulate old paper) fakeScan.resolution=Resolution (DPI) + +#attachments +home.attachments.title=Add Attachments +home.attachments.desc=Add or remove embedded files (attachments) to/from a PDF +attachments.tags=embed,attach,file,attachment,attachments + +attachments.title=Attachments +attachments.header=Add attachments +attachments.removeHeader=Remove attachments from PDF +attachments.selectFiles=Select files to attach +attachments.description=Allows you to add attachments to the PDF +attachments.descriptionPlaceholder=Enter a description for the attachments... +attachments.addButton=Add Attachments +attachments.removeDescription=This will remove all embedded files from the PDF. +attachments.removeButton=Remove All Attachments diff --git a/stirling-pdf/src/test/java/stirling/software/SPDF/controller/api/misc/AttachmentsControllerTest.java b/stirling-pdf/src/test/java/stirling/software/SPDF/controller/api/misc/AttachmentsControllerTest.java new file mode 100644 index 000000000..00f0339e9 --- /dev/null +++ b/stirling-pdf/src/test/java/stirling/software/SPDF/controller/api/misc/AttachmentsControllerTest.java @@ -0,0 +1,209 @@ +package stirling.software.SPDF.controller.api.misc; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.io.IOException; +import java.util.List; + +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDDocumentCatalog; +import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary; +import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode; +import org.apache.pdfbox.pdmodel.PageMode; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.web.multipart.MultipartFile; + +import stirling.software.SPDF.service.PDFAttachmentServiceInterface; +import stirling.software.common.service.CustomPDFDocumentFactory; + +@ExtendWith(MockitoExtension.class) +class AttachmentsControllerTest { + + @Mock + private CustomPDFDocumentFactory pdfDocumentFactory; + + @Mock + private PDFAttachmentServiceInterface pdfAttachmentService; + + @InjectMocks + private AttachmentsController attachmentsController; + + private MockMultipartFile pdfFile; + private MockMultipartFile attachment1; + private MockMultipartFile attachment2; + private PDDocument mockDocument; + private PDDocumentCatalog mockCatalog; + private PDDocumentNameDictionary mockNameDict; + private PDEmbeddedFilesNameTreeNode mockEmbeddedFilesTree; + + @BeforeEach + void setUp() { + pdfFile = new MockMultipartFile("fileInput", "test.pdf", "application/pdf", "PDF content".getBytes()); + attachment1 = new MockMultipartFile("attachment1", "file1.txt", "text/plain", "File 1 content".getBytes()); + attachment2 = new MockMultipartFile("attachment2", "file2.jpg", "image/jpeg", "Image content".getBytes()); + + mockDocument = mock(PDDocument.class); + mockCatalog = mock(PDDocumentCatalog.class); + mockNameDict = mock(PDDocumentNameDictionary.class); + mockEmbeddedFilesTree = mock(PDEmbeddedFilesNameTreeNode.class); + } + + @Test + void addAttachments_WithExistingNames() throws IOException { + List attachments = List.of(attachment1, attachment2); + + when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(mockNameDict); + when(mockNameDict.getEmbeddedFiles()).thenReturn(mockEmbeddedFilesTree); + + ResponseEntity response = attachmentsController.addAttachments(pdfFile, attachments); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfDocumentFactory).load(pdfFile, false); + verify(mockCatalog).setNames(mockNameDict); + verify(pdfAttachmentService).addAttachment(mockDocument, mockEmbeddedFilesTree, attachments); + } + + @Test + void addAttachments_WithoutExistingNames() throws IOException { + List attachments = List.of(attachment1); + + try (PDDocument realDocument = new PDDocument()) { + when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(realDocument); + + ResponseEntity response = attachmentsController.addAttachments(pdfFile, attachments); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfDocumentFactory).load(pdfFile, false); + verify(pdfAttachmentService).addAttachment(eq(realDocument), any(PDEmbeddedFilesNameTreeNode.class), eq(attachments)); + } + } + + @Test + void addAttachments_IOExceptionFromPDFLoad() throws IOException { + List attachments = List.of(attachment1); + IOException ioException = new IOException("Failed to load PDF"); + + when(pdfDocumentFactory.load(pdfFile, false)).thenThrow(ioException); + + assertThrows(IOException.class, () -> attachmentsController.addAttachments(pdfFile, attachments)); + verify(pdfDocumentFactory).load(pdfFile, false); + verifyNoInteractions(pdfAttachmentService); + } + + @Test + void addAttachments_IOExceptionFromAttachmentService() throws IOException { + List attachments = List.of(attachment1); + IOException ioException = new IOException("Failed to add attachment"); + + when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(mockNameDict); + when(mockNameDict.getEmbeddedFiles()).thenReturn(mockEmbeddedFilesTree); + doThrow(ioException).when(pdfAttachmentService).addAttachment(mockDocument, mockEmbeddedFilesTree, attachments); + + assertThrows(IOException.class, () -> attachmentsController.addAttachments(pdfFile, attachments)); + verify(pdfAttachmentService).addAttachment(mockDocument, mockEmbeddedFilesTree, attachments); + } + + @Test + void removeAttachments_WithExistingNames() throws IOException { + when(pdfDocumentFactory.load(pdfFile)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(mockNameDict); + + ResponseEntity response = attachmentsController.removeAttachments(pdfFile); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfDocumentFactory).load(pdfFile); + verify(mockNameDict).setEmbeddedFiles(null); + verify(mockCatalog).setPageMode(PageMode.USE_NONE); + } + + @Test + void removeAttachments_WithoutExistingNames() throws IOException { + when(pdfDocumentFactory.load(pdfFile)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(null); + + ResponseEntity response = attachmentsController.removeAttachments(pdfFile); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfDocumentFactory).load(pdfFile); + verify(mockCatalog).setPageMode(PageMode.USE_NONE); + verifyNoInteractions(mockNameDict); + } + + @Test + void removeAttachments_IOExceptionFromPDFLoad() throws IOException { + IOException ioException = new IOException("Failed to load PDF"); + + when(pdfDocumentFactory.load(pdfFile)).thenThrow(ioException); + + assertThrows(IOException.class, () -> attachmentsController.removeAttachments(pdfFile)); + verify(pdfDocumentFactory).load(pdfFile); + } + + @Test + void addAttachments_EmptyAttachmentsList() throws IOException { + List emptyAttachments = List.of(); + + when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(mockNameDict); + when(mockNameDict.getEmbeddedFiles()).thenReturn(mockEmbeddedFilesTree); + + ResponseEntity response = attachmentsController.addAttachments(pdfFile, emptyAttachments); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfAttachmentService).addAttachment(mockDocument, mockEmbeddedFilesTree, emptyAttachments); + } + + @Test + void addAttachments_NullFilename() throws IOException { + MockMultipartFile attachmentWithNullName = new MockMultipartFile("attachment", null, "text/plain", "content".getBytes()); + List attachments = List.of(attachmentWithNullName); + + when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(mockNameDict); + when(mockNameDict.getEmbeddedFiles()).thenReturn(mockEmbeddedFilesTree); + + ResponseEntity response = attachmentsController.addAttachments(pdfFile, attachments); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(pdfAttachmentService).addAttachment(mockDocument, mockEmbeddedFilesTree, attachments); + } + + @Test + void removeAttachments_NullPDFFilename() throws IOException { + MockMultipartFile pdfWithNullName = new MockMultipartFile("fileInput", null, "application/pdf", "PDF content".getBytes()); + + when(pdfDocumentFactory.load(pdfWithNullName)).thenReturn(mockDocument); + when(mockDocument.getDocumentCatalog()).thenReturn(mockCatalog); + when(mockCatalog.getNames()).thenReturn(null); + + ResponseEntity response = attachmentsController.removeAttachments(pdfWithNullName); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + verify(mockCatalog).setPageMode(PageMode.USE_NONE); + } +} \ No newline at end of file