From b8303e3860842cb3a84e3958fd28f4e1b3fd60c4 Mon Sep 17 00:00:00 2001 From: Sai Kumar <40134996+saikumarjetti@users.noreply.github.com> Date: Sat, 4 Jan 2025 23:31:13 +0530 Subject: [PATCH] Pdf to image custom page selection (#2576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Implemented custom page selection for the pdf-to-image feature, allowing users to specify which PDF pages to convert to images. 1. Variable Renaming: Changed singleOrMultiple to imageResultType because it supports three options: single, multiple, and custom. 2. New Field: Added pageNumbers to accept user-defined page selections. This field appears only when custom is selected in the UI. 3. New Method: Added getPageIndicesToConvert to process and validate the specified page numbers. 4. Method Update: Updated convertFromPdf to handle custom page numbers, ensuring only selected pages are converted. 5. Translation Properties: Added two new English translation properties, custom and customPageNumber, to all language files with placeholder values. These will need to be translated into country-specific languages in the future. Note: If an invalid page number is provided (zero, negative, or exceeds page count), a single image containing all PDF pages is generated. Closes #918 ## Checklist - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have performed a self-review of my own code - [x] I have attached images of the change if it is UI based - [x] I have commented my code, particularly in hard-to-understand areas - [x] If my code has heavily changed functionality I have updated relevant docs on [Stirling-PDFs doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) - [x] My changes generate no new warnings - [x] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ![Screenshot 2025-01-02 at 12 31 29 AM](https://github.com/user-attachments/assets/c4ba3f31-5dd6-4a17-991e-51b86c2eb466) ![Screenshot 2025-01-02 at 12 31 49 AM](https://github.com/user-attachments/assets/3e800a95-2088-4f69-8a01-bd03d7b9e471) --------- Co-authored-by: Sai Kumar J Co-authored-by: Ludy Co-authored-by: saikumar Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> --- .../converters/ConvertImgPDFController.java | 64 ++++++++++++++++--- .../api/converters/ConvertToImageRequest.java | 5 ++ src/main/resources/messages_ar_AR.properties | 1 + src/main/resources/messages_az_AZ.properties | 1 + src/main/resources/messages_bg_BG.properties | 1 + src/main/resources/messages_ca_CA.properties | 1 + src/main/resources/messages_cs_CZ.properties | 1 + src/main/resources/messages_da_DK.properties | 1 + src/main/resources/messages_de_DE.properties | 1 + src/main/resources/messages_el_GR.properties | 1 + src/main/resources/messages_en_GB.properties | 1 + src/main/resources/messages_en_US.properties | 1 + src/main/resources/messages_es_ES.properties | 1 + src/main/resources/messages_eu_ES.properties | 1 + src/main/resources/messages_fa_IR.properties | 1 + src/main/resources/messages_fr_FR.properties | 1 + src/main/resources/messages_ga_IE.properties | 1 + src/main/resources/messages_hi_IN.properties | 1 + src/main/resources/messages_hr_HR.properties | 1 + src/main/resources/messages_hu_HU.properties | 1 + src/main/resources/messages_id_ID.properties | 1 + src/main/resources/messages_it_IT.properties | 1 + src/main/resources/messages_ja_JP.properties | 1 + src/main/resources/messages_ko_KR.properties | 1 + src/main/resources/messages_nl_NL.properties | 1 + src/main/resources/messages_no_NB.properties | 1 + src/main/resources/messages_pl_PL.properties | 1 + src/main/resources/messages_pt_BR.properties | 1 + src/main/resources/messages_pt_PT.properties | 1 + src/main/resources/messages_ro_RO.properties | 1 + src/main/resources/messages_ru_RU.properties | 1 + src/main/resources/messages_sk_SK.properties | 1 + .../resources/messages_sr_LATN_RS.properties | 1 + src/main/resources/messages_sv_SE.properties | 1 + src/main/resources/messages_th_TH.properties | 1 + src/main/resources/messages_tr_TR.properties | 1 + src/main/resources/messages_uk_UA.properties | 1 + src/main/resources/messages_vi_VN.properties | 1 + src/main/resources/messages_zh_CN.properties | 1 + src/main/resources/messages_zh_TW.properties | 1 + .../templates/convert/pdf-to-img.html | 7 ++ 41 files changed, 106 insertions(+), 8 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java index 06f964f4..7bdf7534 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java @@ -13,6 +13,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.apache.commons.io.FileUtils; +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.rendering.ImageType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; @@ -31,11 +34,8 @@ import lombok.extern.slf4j.Slf4j; import stirling.software.SPDF.model.api.converters.ConvertToImageRequest; import stirling.software.SPDF.model.api.converters.ConvertToPdfRequest; import stirling.software.SPDF.service.CustomPDDocumentFactory; -import stirling.software.SPDF.utils.CheckProgramInstall; -import stirling.software.SPDF.utils.PdfUtils; -import stirling.software.SPDF.utils.ProcessExecutor; +import stirling.software.SPDF.utils.*; import stirling.software.SPDF.utils.ProcessExecutor.ProcessExecutorResult; -import stirling.software.SPDF.utils.WebResponseUtils; @RestController @RequestMapping("/api/v1/convert") @@ -62,14 +62,20 @@ public class ConvertImgPDFController { String singleOrMultiple = request.getSingleOrMultiple(); String colorType = request.getColorType(); String dpi = request.getDpi(); - + String pageNumbers = request.getPageNumbers(); Path tempFile = null; Path tempOutputDir = null; Path tempPdfPath = null; byte[] result = null; - + String[] pageOrderArr = + (pageNumbers != null && !pageNumbers.trim().isEmpty()) + ? pageNumbers.split(",") + : new String[] {"all"}; + ; try { - byte[] pdfBytes = file.getBytes(); + // Load the input PDF + byte[] newPdfBytes = rearrangePdfPages(file.getBytes(), pageOrderArr); + ImageType colorTypeResult = ImageType.RGB; if ("greyscale".equals(colorType)) { colorTypeResult = ImageType.GRAY; @@ -84,7 +90,7 @@ public class ConvertImgPDFController { result = PdfUtils.convertFromPdf( - pdfBytes, + newPdfBytes, "webp".equalsIgnoreCase(imageFormat) ? "png" : imageFormat.toUpperCase(), @@ -227,4 +233,46 @@ public class ConvertImgPDFController { String mimeType = URLConnection.guessContentTypeFromName("." + imageFormat); return "null".equals(mimeType) ? "application/octet-stream" : mimeType; } + + /** + * Rearranges the pages of the given PDF document based on the specified page order. + * + * @param pdfBytes The byte array of the original PDF file. + * @param pageOrderArr An array of page numbers indicating the new order. + * @return A byte array of the rearranged PDF. + * @throws IOException If an error occurs while processing the PDF. + */ + private byte[] rearrangePdfPages(byte[] pdfBytes, String[] pageOrderArr) throws IOException { + // Load the input PDF + PDDocument document = Loader.loadPDF(pdfBytes); + int totalPages = document.getNumberOfPages(); + List newPageOrder = GeneralUtils.parsePageList(pageOrderArr, totalPages, false); + + // Create a new list to hold the pages in the new order + List newPages = new ArrayList<>(); + for (int pageIndex : newPageOrder) { + newPages.add(document.getPage(pageIndex)); + } + + // Remove all the pages from the original document + for (int i = document.getNumberOfPages() - 1; i >= 0; i--) { + document.removePage(i); + } + + // Add the pages in the new order + for (PDPage page : newPages) { + document.addPage(page); + } + + // Convert PDDocument to byte array + byte[] newPdfBytes; + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + document.save(baos); + newPdfBytes = baos.toByteArray(); + } finally { + document.close(); + } + + return newPdfBytes; + } } diff --git a/src/main/java/stirling/software/SPDF/model/api/converters/ConvertToImageRequest.java b/src/main/java/stirling/software/SPDF/model/api/converters/ConvertToImageRequest.java index 3bde3e16..87d30e62 100644 --- a/src/main/java/stirling/software/SPDF/model/api/converters/ConvertToImageRequest.java +++ b/src/main/java/stirling/software/SPDF/model/api/converters/ConvertToImageRequest.java @@ -21,6 +21,11 @@ public class ConvertToImageRequest extends PDFFile { allowableValues = {"single", "multiple"}) private String singleOrMultiple; + @Schema( + description = + "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')\"") + private String pageNumbers; + @Schema( description = "The color type of the output image(s)", allowableValues = {"color", "greyscale", "blackwhite"}) diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index 67b08084..11f71220 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=تدرج الرمادي pdfToImage.blackwhite=أبيض وأسود (قد يفقد البيانات!) pdfToImage.submit=تحويل pdfToImage.info=Python غير مثبت. مطلوب لتحويل WebP. +pdfToImage.placeholder=(مثال: 1,2,8 أو 4,7,12-16 أو 2n-1) #addPassword diff --git a/src/main/resources/messages_az_AZ.properties b/src/main/resources/messages_az_AZ.properties index 471eafaa..edeaf7cb 100644 --- a/src/main/resources/messages_az_AZ.properties +++ b/src/main/resources/messages_az_AZ.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Boz Tonlama pdfToImage.blackwhite=Qara və Ağ (Data İtə Bilər) pdfToImage.submit=Çevir pdfToImage.info=Python Yüklü Deyil.WebP Çevirməsi Üçün Vacibdir +pdfToImage.placeholder=(məsələn, 1,2,8 və ya 4,7,12-16 və ya 2n-1) #addPassword diff --git a/src/main/resources/messages_bg_BG.properties b/src/main/resources/messages_bg_BG.properties index 57c0e8a3..2891672d 100644 --- a/src/main/resources/messages_bg_BG.properties +++ b/src/main/resources/messages_bg_BG.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Скала на сивото pdfToImage.blackwhite=Черно и бяло (може да загубите данни!) pdfToImage.submit=Преобразуване pdfToImage.info=Python не е инсталиран. Изисква се за конвертиране на WebP. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index 3257a155..6b080566 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Escala de Grisos pdfToImage.blackwhite=Blanc i Negre (Pot perdre dades!) pdfToImage.submit=Converteix pdfToImage.info=Python no està instal·lat. És necessari per a la conversió a WebP. +pdfToImage.placeholder=(p. ex. 1,2,8 o 4,7,12-16 o 2n-1) #addPassword diff --git a/src/main/resources/messages_cs_CZ.properties b/src/main/resources/messages_cs_CZ.properties index bc793279..5da9fe37 100644 --- a/src/main/resources/messages_cs_CZ.properties +++ b/src/main/resources/messages_cs_CZ.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Stupně šedi pdfToImage.blackwhite=Černobílý (Může dojít k ztrátě dat!) pdfToImage.submit=Převést pdfToImage.info=Python není nainstalován. Potřebuje se pro konverzi do WebP. +pdfToImage.placeholder=(např. 1,2,8 nebo 4,7,12-16 nebo 2n-1) #addPassword diff --git a/src/main/resources/messages_da_DK.properties b/src/main/resources/messages_da_DK.properties index 71fea763..6cb5ec71 100644 --- a/src/main/resources/messages_da_DK.properties +++ b/src/main/resources/messages_da_DK.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Gråtone pdfToImage.blackwhite=Sort og Hvid (Kan miste data!) pdfToImage.submit=Konvertér pdfToImage.info=Python er ikke installeret. Påkrævet for WebP-konvertering. +pdfToImage.placeholder=(f.eks. 1,2,8 eller 4,7,12-16 eller 2n-1) #addPassword diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 91064956..b9a79a2d 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Graustufen pdfToImage.blackwhite=Schwarzweiß (Datenverlust möglich!) pdfToImage.submit=Umwandeln pdfToImage.info=Python ist nicht installiert. Erforderlich für die WebP-Konvertierung. +pdfToImage.placeholder=(z.B. 1,2,8 oder 4,7,12-16 oder 2n-1) #addPassword diff --git a/src/main/resources/messages_el_GR.properties b/src/main/resources/messages_el_GR.properties index 99cc37e9..e3e57d50 100644 --- a/src/main/resources/messages_el_GR.properties +++ b/src/main/resources/messages_el_GR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Κλίμακα του γκρι pdfToImage.blackwhite=Ασπρόμαυρο (Μπορεί να χαθούν δεδομένα!) pdfToImage.submit=Μετατροπή pdfToImage.info=Δεν είναι ιστάμενος Python. Είναι απαιτήτων για τη μετατροπή σε WebP. +pdfToImage.placeholder=(π.χ. 1,2,8 ή 4,7,12-16 ή 2n-1) #addPassword diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 42069459..a14cc332 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Greyscale pdfToImage.blackwhite=Black and White (May lose data!) pdfToImage.submit=Convert pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index 6c90e559..76039f4b 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Grayscale pdfToImage.blackwhite=Black and White (May lose data!) pdfToImage.submit=Convert pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index 7401569e..52b7cea7 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Escala de grises pdfToImage.blackwhite=Blanco y Negro (¡Puede perder datos!) pdfToImage.submit=Convertir pdfToImage.info=Python no está instalado. Se requiere para la conversión WebP. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_eu_ES.properties b/src/main/resources/messages_eu_ES.properties index 44df5362..6d5edff1 100644 --- a/src/main/resources/messages_eu_ES.properties +++ b/src/main/resources/messages_eu_ES.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Gris-eskala pdfToImage.blackwhite=Zuria eta Beltza (Datuak galdu ditzake!) pdfToImage.submit=Bihurtu pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_fa_IR.properties b/src/main/resources/messages_fa_IR.properties index 0be07738..4117d94d 100644 --- a/src/main/resources/messages_fa_IR.properties +++ b/src/main/resources/messages_fa_IR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=خاکستری pdfToImage.blackwhite=سیاه و سفید (ممکن است اطلاعات از دست برود!) pdfToImage.submit=تبدیل pdfToImage.info=پایتون نصب نشده است. برای تبدیل WebP لازم است. +pdfToImage.placeholder=(مثال: 1,2,8 یا 4,7,12-16 یا 2n-1) #addPassword diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 36c92b5e..4dd480bc 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Niveaux de gris pdfToImage.blackwhite=Noir et blanc (peut engendrer une perte de données !) pdfToImage.submit=Convertir pdfToImage.info=Python n’est pas installé. Nécessaire pour la conversion WebP. +pdfToImage.placeholder=(par exemple : 1,2,8 ou 4,7,12-16 ou 2n-1) #addPassword diff --git a/src/main/resources/messages_ga_IE.properties b/src/main/resources/messages_ga_IE.properties index c9cb7355..7e8aefe3 100644 --- a/src/main/resources/messages_ga_IE.properties +++ b/src/main/resources/messages_ga_IE.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Scála Liath pdfToImage.blackwhite=Dubh agus Bán (D’fhéadfadh sonraí a chailleadh!) pdfToImage.submit=Tiontaigh pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(m.sh. 1,2,8 nó 4,7,12-16 nó 2n-1) #addPassword diff --git a/src/main/resources/messages_hi_IN.properties b/src/main/resources/messages_hi_IN.properties index 994d2e80..65e7b899 100644 --- a/src/main/resources/messages_hi_IN.properties +++ b/src/main/resources/messages_hi_IN.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=ग्रे स्केल pdfToImage.blackwhite=काला और सफेद (डेटा खो सकता है!) pdfToImage.submit=परिवर्तित करें pdfToImage.info=पायथन नहीं अनिस्तारित है। वेबP परिवर्तन के लिए आवश्यक है। +pdfToImage.placeholder=(उदाहरण के लिए 1,2,8 या 4,7,12-16 या 2n-1) #addPassword diff --git a/src/main/resources/messages_hr_HR.properties b/src/main/resources/messages_hr_HR.properties index 2e215748..9aaf5aca 100644 --- a/src/main/resources/messages_hr_HR.properties +++ b/src/main/resources/messages_hr_HR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Sivi tonovi pdfToImage.blackwhite=Crno-bijelo (mogu se izgubiti podaci!) pdfToImage.submit=Pretvori pdfToImage.info=Python nije instaliran. Treba je za konverziju na WebP. +pdfToImage.placeholder=(t.j. 1,2,8 ili 4,7,12-16 ili 2n-1) #addPassword diff --git a/src/main/resources/messages_hu_HU.properties b/src/main/resources/messages_hu_HU.properties index a1bcc7ae..dfe4a0bc 100644 --- a/src/main/resources/messages_hu_HU.properties +++ b/src/main/resources/messages_hu_HU.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=szürkeárnyalatos pdfToImage.blackwhite=fekete-fehér (adatvesztéssel járhat!) pdfToImage.submit=Átalakítás pdfToImage.info=Nincs telepítve a Python. Szükséges a WebP konverzióhoz. +pdfToImage.placeholder=(pl. 1,2,8 vagy 4,7,12-16 vagy 2n-1) #addPassword diff --git a/src/main/resources/messages_id_ID.properties b/src/main/resources/messages_id_ID.properties index f61147f0..80bc36fb 100644 --- a/src/main/resources/messages_id_ID.properties +++ b/src/main/resources/messages_id_ID.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Skala abu-abu pdfToImage.blackwhite=Black and White (Bisa kehilangan data!) pdfToImage.submit=Konversi pdfToImage.info=Python tidak terinstal. Diperlukan untuk konversi WebP. +pdfToImage.placeholder=(misalnya 1,2,8 atau 4,7,12-16 atau 2n-1) #addPassword diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index 6f2602e2..833037f4 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Scala di grigi pdfToImage.blackwhite=Bianco e Nero (potresti perdere dettagli!) pdfToImage.submit=Converti pdfToImage.info=Python non è installato.È richiesto per la conversione WebP. +pdfToImage.placeholder=(es. 1,2,8 o 4,7,12-16 o 2n-1) #addPassword diff --git a/src/main/resources/messages_ja_JP.properties b/src/main/resources/messages_ja_JP.properties index 16afc859..6645e906 100644 --- a/src/main/resources/messages_ja_JP.properties +++ b/src/main/resources/messages_ja_JP.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=グレースケール pdfToImage.blackwhite=白黒 (データが失われる可能性があります!) pdfToImage.submit=変換 pdfToImage.info=Pythonがインストールされていません。WebPの変換に必要です。 +pdfToImage.placeholder=(例:1,2,8、4,7,12-16、2n-1) #addPassword diff --git a/src/main/resources/messages_ko_KR.properties b/src/main/resources/messages_ko_KR.properties index 83c48e47..c00f4084 100644 --- a/src/main/resources/messages_ko_KR.properties +++ b/src/main/resources/messages_ko_KR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=그레이스케일 pdfToImage.blackwhite=흑백 (데이터 손실 가능성 있음!) pdfToImage.submit=변환 pdfToImage.info=Python이 설치되어 있지 않습니다. WebP 변환에 필요합니다. +pdfToImage.placeholder=(예: 1,2,8 또는 4,7,12-16 또는 2n-1) #addPassword diff --git a/src/main/resources/messages_nl_NL.properties b/src/main/resources/messages_nl_NL.properties index 76b57ef7..aa3d5cba 100644 --- a/src/main/resources/messages_nl_NL.properties +++ b/src/main/resources/messages_nl_NL.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Grijstinten pdfToImage.blackwhite=Zwart en wit (kan data verliezen!) pdfToImage.submit=Omzetten pdfToImage.info=Python is niet geïnstalleerd. Vereist voor WebP-conversie. +pdfToImage.placeholder=(bijv. 1,2,8 of 4,7,12-16 of 2n-1) #addPassword diff --git a/src/main/resources/messages_no_NB.properties b/src/main/resources/messages_no_NB.properties index d6fb339d..69e4e633 100644 --- a/src/main/resources/messages_no_NB.properties +++ b/src/main/resources/messages_no_NB.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Gråtone pdfToImage.blackwhite=Svart-hvitt (kan miste data!) pdfToImage.submit=Konverter pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(f.eks. 1,2,8 eller 4,7,12-16 eller 2n-1) #addPassword diff --git a/src/main/resources/messages_pl_PL.properties b/src/main/resources/messages_pl_PL.properties index ee567212..44a1a3a6 100644 --- a/src/main/resources/messages_pl_PL.properties +++ b/src/main/resources/messages_pl_PL.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Odcień szarości pdfToImage.blackwhite=Czarno-biały (może spowodować utratę danych!) pdfToImage.submit=Konwertuj pdfToImage.info=Python nie został zainstalowany. Jest wymagany do konwersji WebP. +pdfToImage.placeholder=(przykład 1,2,8 lub 2n-1) #addPassword diff --git a/src/main/resources/messages_pt_BR.properties b/src/main/resources/messages_pt_BR.properties index b5b1656c..3560cbc4 100644 --- a/src/main/resources/messages_pt_BR.properties +++ b/src/main/resources/messages_pt_BR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Escala de Cinza pdfToImage.blackwhite=Preto e Branco (pode perder informações!) pdfToImage.submit=Converter pdfToImage.info=Python não está instalado. Necessário para conversão WebP. +pdfToImage.placeholder=(por exemplo 1,2,8 or 4,7,12-16 ou 2n-1) #addPassword diff --git a/src/main/resources/messages_pt_PT.properties b/src/main/resources/messages_pt_PT.properties index 0fe76bb7..7973686c 100644 --- a/src/main/resources/messages_pt_PT.properties +++ b/src/main/resources/messages_pt_PT.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Escala de Cinza pdfToImage.blackwhite=Preto e Branco (pode resultar em perda de dados!) pdfToImage.submit=Converter pdfToImage.info=O Python não está instalado. Necessário para a conversão de WebP. +pdfToImage.placeholder=(ex: 1,2,8 ou 4,7,12-16 ou 2n-1) #addPassword diff --git a/src/main/resources/messages_ro_RO.properties b/src/main/resources/messages_ro_RO.properties index f3688a73..7a9ba568 100644 --- a/src/main/resources/messages_ro_RO.properties +++ b/src/main/resources/messages_ro_RO.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Scală de gri pdfToImage.blackwhite=Alb și negru (Poate pierde date!) pdfToImage.submit=Convertește pdfToImage.info=Python nu este instalat. Necesar pentru conversia WebP. +pdfToImage.placeholder=(ex. 1,2,8 sau 4,7,12-16 sau 2n-1) #addPassword diff --git a/src/main/resources/messages_ru_RU.properties b/src/main/resources/messages_ru_RU.properties index 6a5b1569..b4bf19b7 100644 --- a/src/main/resources/messages_ru_RU.properties +++ b/src/main/resources/messages_ru_RU.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Оттенки серого pdfToImage.blackwhite=Черно-белый (может потерять данные!) pdfToImage.submit=Конвертировать pdfToImage.info=Питон не установлен. Необходим для конвертации в WebP. +pdfToImage.placeholder=(например 1,2,8 или 4,7,12-16 или 2n-1) #addPassword diff --git a/src/main/resources/messages_sk_SK.properties b/src/main/resources/messages_sk_SK.properties index aed43635..55731004 100644 --- a/src/main/resources/messages_sk_SK.properties +++ b/src/main/resources/messages_sk_SK.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Odtiene šedej pdfToImage.blackwhite=Čierno-biele (Môže stratiť údaje!) pdfToImage.submit=Konvertovať pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(napr. 1,2,8 alebo 4,7,12-16 alebo 2n-1) #addPassword diff --git a/src/main/resources/messages_sr_LATN_RS.properties b/src/main/resources/messages_sr_LATN_RS.properties index 4c17fd28..6b4c6c83 100644 --- a/src/main/resources/messages_sr_LATN_RS.properties +++ b/src/main/resources/messages_sr_LATN_RS.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Nijanse sive pdfToImage.blackwhite=Crno-belo (Može izgubiti podatke!) pdfToImage.submit=Konvertuj pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(e.g. 1,2,8 or 4,7,12-16 or 2n-1) #addPassword diff --git a/src/main/resources/messages_sv_SE.properties b/src/main/resources/messages_sv_SE.properties index 78d6b646..f66873df 100644 --- a/src/main/resources/messages_sv_SE.properties +++ b/src/main/resources/messages_sv_SE.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Gråskala pdfToImage.blackwhite=Svartvitt (kan förlora data!) pdfToImage.submit=Konvertera pdfToImage.info=Python är inte installerat. Krävs för WebP-konvertering. +pdfToImage.placeholder=(t.ex. 1,2,8 eller 4,7,12-16 eller 2n-1) #addPassword diff --git a/src/main/resources/messages_th_TH.properties b/src/main/resources/messages_th_TH.properties index 33711c13..d3b531b9 100644 --- a/src/main/resources/messages_th_TH.properties +++ b/src/main/resources/messages_th_TH.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=ระดับสีเทา pdfToImage.blackwhite=ขาวดำ (อาจสูญเสียข้อมูล!) pdfToImage.submit=แปลง pdfToImage.info=Python ไม่มีการติดตั้ง จำเป็นสำหรับการแปลง WebP +pdfToImage.placeholder=(เช่น 1,2,8 หรือ 4,7,12-16 หรือ 2n-1) #addPassword diff --git a/src/main/resources/messages_tr_TR.properties b/src/main/resources/messages_tr_TR.properties index 7c5ca7b6..40253d39 100644 --- a/src/main/resources/messages_tr_TR.properties +++ b/src/main/resources/messages_tr_TR.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Gri tonlama pdfToImage.blackwhite=Siyah ve Beyaz (Veri kaybolabilir!) pdfToImage.submit=Dönüştür pdfToImage.info=Python kurulu değil. WebP dönüşümü için gereklidir. +pdfToImage.placeholder=(örneğin 1,2,8 veya 4,7,12-16 ya da 2n-1) #addPassword diff --git a/src/main/resources/messages_uk_UA.properties b/src/main/resources/messages_uk_UA.properties index a43bb399..772547ac 100644 --- a/src/main/resources/messages_uk_UA.properties +++ b/src/main/resources/messages_uk_UA.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Відтінки сірого pdfToImage.blackwhite=Чорно-білий (може втратити дані!) pdfToImage.submit=Конвертувати pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(наприклад 1,2,8 або 4,7,12-16 або 2n-1) #addPassword diff --git a/src/main/resources/messages_vi_VN.properties b/src/main/resources/messages_vi_VN.properties index ae1e47f0..d97df525 100644 --- a/src/main/resources/messages_vi_VN.properties +++ b/src/main/resources/messages_vi_VN.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=Thang độ xám pdfToImage.blackwhite=Đen trắng (Có thể mất dữ liệu!) pdfToImage.submit=Chuyển đổi pdfToImage.info=Python is not installed. Required for WebP conversion. +pdfToImage.placeholder=(ví dụ: 1,2,8 hoặc 4,7,12-16 hoặc 2n-1) #addPassword diff --git a/src/main/resources/messages_zh_CN.properties b/src/main/resources/messages_zh_CN.properties index 921faf0c..c2845954 100644 --- a/src/main/resources/messages_zh_CN.properties +++ b/src/main/resources/messages_zh_CN.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=灰度 pdfToImage.blackwhite=黑白(可能会丢失数据!)。 pdfToImage.submit=转换 pdfToImage.info=WebP 转换需要安装 Python +pdfToImage.placeholder=(例如:1,2,8 或 4,7,12-16 或 2n-1) #addPassword diff --git a/src/main/resources/messages_zh_TW.properties b/src/main/resources/messages_zh_TW.properties index cf6dfb9d..41661f03 100644 --- a/src/main/resources/messages_zh_TW.properties +++ b/src/main/resources/messages_zh_TW.properties @@ -1042,6 +1042,7 @@ pdfToImage.grey=灰度 pdfToImage.blackwhite=黑白(可能會遺失資料!) pdfToImage.submit=轉換 pdfToImage.info=尚未安裝 Python。需要安裝 Python 才能進行 WebP 轉換。 +pdfToImage.placeholder=(例如 1,2,8 或 4,7,12-16 或 2n-1) #addPassword diff --git a/src/main/resources/templates/convert/pdf-to-img.html b/src/main/resources/templates/convert/pdf-to-img.html index c9efb0e7..d83ef4e9 100644 --- a/src/main/resources/templates/convert/pdf-to-img.html +++ b/src/main/resources/templates/convert/pdf-to-img.html @@ -39,6 +39,12 @@ + +
+ + +