Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
3.6 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
2024-05-22 21:48:23 +01:00
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}" xmlns:th="https://www.thymeleaf.org">
<head>
<th:block th:insert="~{fragments/common :: head(title=#{pdfToImage.title}, header=#{pdfToImage.header})}"></th:block>
</head>
2024-02-11 11:47:00 -05:00
<body>
<th:block th:insert="~{fragments/common :: game}"></th:block>
<div id="page-container">
<div id="content-wrap">
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
<br><br>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-6 bg-card">
<div class="tool-header">
<span class="material-symbols-rounded tool-header-icon image">image</span>
<span class="tool-header-text" th:text="#{pdfToImage.header}"></span>
</div>
<p th:text="#{processTimeWarning}"></p>
<p th:if="${!isPython}" th:text="#{pdfToImage.info}">Python is not installed. Required for WebP conversion.</p>
<form method="post" enctype="multipart/form-data" th:action="@{'/api/v1/convert/pdf/img'}">
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multipleInputsForSingleRequest=false, accept='application/pdf')}"></div>
<div class="mb-3">
<label th:text="#{pdfToImage.selectText}"></label>
<select class="form-control" name="imageFormat">
<option value="png">PNG</option>
<option value="jpg">JPG</option>
<option value="gif">GIF</option>
<option value="tiff">TIFF</option>
<option value="bmp">BMP</option>
<option th:if="${isPython}" value="webp">WEBP</option>
</select>
</div>
<div class="mb-3">
<label th:text="#{pdfToImage.singleOrMultiple}"></label>
<select class="form-control" name="singleOrMultiple">
<option value="multiple" th:text="#{pdfToImage.multi}"></option>
<option value="single" th:text="#{pdfToImage.single}"></option>
</select>
</div>
Pdf to image custom page selection (#2576) # 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 <saikumar@Sais-MacBook-Air.local> Co-authored-by: Ludy <Ludy87@users.noreply.github.com> Co-authored-by: saikumar <saikumar.jetti@gmail.com> Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2025-01-04 23:31:13 +05:30
<div class="mb-3" id="singleOptionSection" >
<label for="pageNumbers" th:text="#{pageSelectionPrompt}"></label>
<input type="text" name="pageNumbers" class="form-control" id="pageNumbers" value="all"
th:placeholder="#{pdfToImage.placeholder}" required>
</div>
<div class="mb-3">
<label th:text="#{pdfToImage.colorType}"></label>
<select class="form-control" name="colorType">
<option value="color" th:text="#{pdfToImage.color}"></option>
<option value="greyscale" th:text="#{pdfToImage.grey}"></option>
<option value="blackwhite" th:text="#{pdfToImage.blackwhite}"></option>
</select>
</div>
<div class="mb-3">
<label for="dpi">DPI:</label>
<input type="number" name="dpi" class="form-control" id="dpi" min="1" step="1" value="300" required>
</div>
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{pdfToImage.submit}"></button>
</form>
</div>
</div>
</div>
</div>
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
</div>
Pdf to image custom page selection (#2576) # 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 <saikumar@Sais-MacBook-Air.local> Co-authored-by: Ludy <Ludy87@users.noreply.github.com> Co-authored-by: saikumar <saikumar.jetti@gmail.com> Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2025-01-04 23:31:13 +05:30
</body>
</html>