mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
added attachments text to language files
This commit is contained in:
parent
beb1f35abd
commit
978e6f3d0c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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<MultipartFile> 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<byte[]> 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<MultipartFile> attachments = List.of(attachment1);
|
||||
|
||||
try (PDDocument realDocument = new PDDocument()) {
|
||||
when(pdfDocumentFactory.load(pdfFile, false)).thenReturn(realDocument);
|
||||
|
||||
ResponseEntity<byte[]> 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<MultipartFile> 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<MultipartFile> 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<byte[]> 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<byte[]> 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<MultipartFile> 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<byte[]> 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<MultipartFile> 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<byte[]> 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<byte[]> response = attachmentsController.removeAttachments(pdfWithNullName);
|
||||
|
||||
assertNotNull(response);
|
||||
assertEquals(HttpStatus.OK, response.getStatusCode());
|
||||
verify(mockCatalog).setPageMode(PageMode.USE_NONE);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user