diff --git a/README.md b/README.md index e16232fa666..56cb25afc40 100644 --- a/README.md +++ b/README.md @@ -172,42 +172,42 @@ Stirling PDF currently supports 38! | Language | Progress | | ------------------------------------------- | -------------------------------------- | -| Arabic (العربية) (ar_AR) | ![99%](https://geps.dev/progress/99) | -| Basque (Euskara) (eu_ES) | ![60%](https://geps.dev/progress/60) | -| Bulgarian (Български) (bg_BG) | ![91%](https://geps.dev/progress/91) | -| Catalan (Català) (ca_CA) | ![47%](https://geps.dev/progress/47) | -| Croatian (Hrvatski) (hr_HR) | ![91%](https://geps.dev/progress/91) | -| Czech (Česky) (cs_CZ) | ![87%](https://geps.dev/progress/87) | -| Danish (Dansk) (da_DK) | ![96%](https://geps.dev/progress/96) | -| Dutch (Nederlands) (nl_NL) | ![93%](https://geps.dev/progress/93) | +| Arabic (العربية) (ar_AR) | ![97%](https://geps.dev/progress/97) | +| Basque (Euskara) (eu_ES) | ![58%](https://geps.dev/progress/58) | +| Bulgarian (Български) (bg_BG) | ![89%](https://geps.dev/progress/89) | +| Catalan (Català) (ca_CA) | ![46%](https://geps.dev/progress/46) | +| Croatian (Hrvatski) (hr_HR) | ![89%](https://geps.dev/progress/89) | +| Czech (Česky) (cs_CZ) | ![85%](https://geps.dev/progress/85) | +| Danish (Dansk) (da_DK) | ![94%](https://geps.dev/progress/94) | +| Dutch (Nederlands) (nl_NL) | ![91%](https://geps.dev/progress/91) | | English (English) (en_GB) | ![100%](https://geps.dev/progress/100) | | English (US) (en_US) | ![100%](https://geps.dev/progress/100) | -| French (Français) (fr_FR) | ![90%](https://geps.dev/progress/90) | -| German (Deutsch) (de_DE) | ![99%](https://geps.dev/progress/99) | -| Greek (Ελληνικά) (el_GR) | ![79%](https://geps.dev/progress/79) | -| Hindi (हिंदी) (hi_IN) | ![76%](https://geps.dev/progress/76) | -| Hungarian (Magyar) (hu_HU) | ![73%](https://geps.dev/progress/73) | -| Indonesia (Bahasa Indonesia) (id_ID) | ![74%](https://geps.dev/progress/74) | -| Irish (Gaeilge) (ga_IE) | ![95%](https://geps.dev/progress/95) | +| French (Français) (fr_FR) | ![88%](https://geps.dev/progress/88) | +| German (Deutsch) (de_DE) | ![97%](https://geps.dev/progress/97) | +| Greek (Ελληνικά) (el_GR) | ![78%](https://geps.dev/progress/78) | +| Hindi (हिंदी) (hi_IN) | ![74%](https://geps.dev/progress/74) | +| Hungarian (Magyar) (hu_HU) | ![71%](https://geps.dev/progress/71) | +| Indonesia (Bahasa Indonesia) (id_ID) | ![72%](https://geps.dev/progress/72) | +| Irish (Gaeilge) (ga_IE) | ![93%](https://geps.dev/progress/93) | | Italian (Italiano) (it_IT) | ![99%](https://geps.dev/progress/99) | -| Japanese (日本語) (ja_JP) | ![92%](https://geps.dev/progress/92) | -| Korean (한국어) (ko_KR) | ![81%](https://geps.dev/progress/81) | -| Norwegian (Norsk) (no_NB) | ![95%](https://geps.dev/progress/95) | -| Polish (Polski) (pl_PL) | ![89%](https://geps.dev/progress/89) | -| Portuguese (Português) (pt_PT) | ![76%](https://geps.dev/progress/76) | -| Portuguese Brazilian (Português) (pt_BR) | ![99%](https://geps.dev/progress/99) | -| Romanian (Română) (ro_RO) | ![97%](https://geps.dev/progress/97) | -| Russian (Русский) (ru_RU) | ![81%](https://geps.dev/progress/81) | -| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![76%](https://geps.dev/progress/76) | -| Simplified Chinese (简体中文) (zh_CN) | ![98%](https://geps.dev/progress/98) | -| Slovakian (Slovensky) (sk_SK) | ![89%](https://geps.dev/progress/89) | -| Spanish (Español) (es_ES) | ![98%](https://geps.dev/progress/98) | -| Swedish (Svenska) (sv_SE) | ![97%](https://geps.dev/progress/97) | -| Thai (ไทย) (th_TH) | ![96%](https://geps.dev/progress/96) | -| Traditional Chinese (繁體中文) (zh_TW) | ![95%](https://geps.dev/progress/95) | -| Turkish (Türkçe) (tr_TR) | ![99%](https://geps.dev/progress/99) | -| Ukrainian (Українська) (uk_UA) | ![87%](https://geps.dev/progress/87) | -| Vietnamese (Tiếng Việt) (vi_VN) | ![96%](https://geps.dev/progress/96) | +| Japanese (日本語) (ja_JP) | ![90%](https://geps.dev/progress/90) | +| Korean (한국어) (ko_KR) | ![80%](https://geps.dev/progress/80) | +| Norwegian (Norsk) (no_NB) | ![93%](https://geps.dev/progress/93) | +| Polish (Polski) (pl_PL) | ![87%](https://geps.dev/progress/87) | +| Portuguese (Português) (pt_PT) | ![74%](https://geps.dev/progress/74) | +| Portuguese Brazilian (Português) (pt_BR) | ![97%](https://geps.dev/progress/97) | +| Romanian (Română) (ro_RO) | ![95%](https://geps.dev/progress/95) | +| Russian (Русский) (ru_RU) | ![79%](https://geps.dev/progress/79) | +| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![74%](https://geps.dev/progress/74) | +| Simplified Chinese (简体中文) (zh_CN) | ![96%](https://geps.dev/progress/96) | +| Slovakian (Slovensky) (sk_SK) | ![87%](https://geps.dev/progress/87) | +| Spanish (Español) (es_ES) | ![96%](https://geps.dev/progress/96) | +| Swedish (Svenska) (sv_SE) | ![95%](https://geps.dev/progress/95) | +| Thai (ไทย) (th_TH) | ![94%](https://geps.dev/progress/94) | +| Traditional Chinese (繁體中文) (zh_TW) | ![93%](https://geps.dev/progress/93) | +| Turkish (Türkçe) (tr_TR) | ![97%](https://geps.dev/progress/97) | +| Ukrainian (Українська) (uk_UA) | ![85%](https://geps.dev/progress/85) | +| Vietnamese (Tiếng Việt) (vi_VN) | ![94%](https://geps.dev/progress/94) | ## Contributing (creating issues, translations, fixing bugs, etc.) diff --git a/src/main/java/stirling/software/SPDF/Factories/ReplaceAndInvertColorFactory.java b/src/main/java/stirling/software/SPDF/Factories/ReplaceAndInvertColorFactory.java new file mode 100644 index 00000000000..6aeb4b2d8b4 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/Factories/ReplaceAndInvertColorFactory.java @@ -0,0 +1,39 @@ +package stirling.software.SPDF.Factories; + +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import stirling.software.SPDF.model.api.misc.HighContrastColorCombination; +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; +import stirling.software.SPDF.utils.misc.CustomColorReplaceStrategy; +import stirling.software.SPDF.utils.misc.InvertFullColorStrategy; +import stirling.software.SPDF.utils.misc.ReplaceAndInvertColorStrategy; + +@Component +public class ReplaceAndInvertColorFactory { + + public ReplaceAndInvertColorStrategy replaceAndInvert( + MultipartFile file, + ReplaceAndInvert replaceAndInvertOption, + HighContrastColorCombination highContrastColorCombination, + String backGroundColor, + String textColor) { + + if (replaceAndInvertOption == ReplaceAndInvert.CUSTOM_COLOR + || replaceAndInvertOption == ReplaceAndInvert.HIGH_CONTRAST_COLOR) { + + return new CustomColorReplaceStrategy( + file, + replaceAndInvertOption, + textColor, + backGroundColor, + highContrastColorCombination); + + } else if (replaceAndInvertOption == ReplaceAndInvert.FULL_INVERSION) { + + return new InvertFullColorStrategy(file, replaceAndInvertOption); + } + + return null; + } +} diff --git a/src/main/java/stirling/software/SPDF/controller/api/misc/ReplaceAndInvertColorController.java b/src/main/java/stirling/software/SPDF/controller/api/misc/ReplaceAndInvertColorController.java new file mode 100644 index 00000000000..c7296a1bfaf --- /dev/null +++ b/src/main/java/stirling/software/SPDF/controller/api/misc/ReplaceAndInvertColorController.java @@ -0,0 +1,55 @@ +package stirling.software.SPDF.controller.api.misc; + +import java.io.IOException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.InputStreamResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import io.swagger.v3.oas.annotations.Operation; + +import stirling.software.SPDF.model.api.misc.ReplaceAndInvertColorRequest; +import stirling.software.SPDF.service.misc.ReplaceAndInvertColorService; + +@RestController +@RequestMapping("/api/v1/misc") +public class ReplaceAndInvertColorController { + + private ReplaceAndInvertColorService replaceAndInvertColorService; + + @Autowired + public ReplaceAndInvertColorController( + ReplaceAndInvertColorService replaceAndInvertColorService) { + this.replaceAndInvertColorService = replaceAndInvertColorService; + } + + @PostMapping(consumes = "multipart/form-data", value = "/replace-invert-pdf") + @Operation( + summary = "Replace-Invert Color PDF", + description = + "This endpoint accepts a PDF file and option of invert all colors or replace text and background colors. Input:PDF Output:PDF Type:SISO") + public ResponseEntity replaceAndInvertColor( + @ModelAttribute ReplaceAndInvertColorRequest replaceAndInvertColorRequest) + throws IOException { + + InputStreamResource resource = + replaceAndInvertColorService.replaceAndInvertColor( + replaceAndInvertColorRequest.getFileInput(), + replaceAndInvertColorRequest.getReplaceAndInvertOption(), + replaceAndInvertColorRequest.getHighContrastColorCombination(), + replaceAndInvertColorRequest.getBackGroundColor(), + replaceAndInvertColorRequest.getTextColor()); + + // Return the modified PDF as a downloadable file + return ResponseEntity.ok() + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=inverted.pdf") + .contentType(MediaType.APPLICATION_PDF) + .body(resource); + } +} diff --git a/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java b/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java index 8b6178bd63a..7f87d4f2260 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/OtherWebController.java @@ -31,6 +31,13 @@ public String compressPdfForm(Model model) { return "misc/compress-pdf"; } + @GetMapping("/replace-and-invert-color-pdf") + @Hidden + public String replaceAndInvertColorPdfForm(Model model) { + model.addAttribute("currentPage", "replace-invert-color-pdf"); + return "misc/replace-color"; + } + @GetMapping("/extract-image-scans") @Hidden public ModelAndView extractImageScansForm() { diff --git a/src/main/java/stirling/software/SPDF/model/api/misc/HighContrastColorCombination.java b/src/main/java/stirling/software/SPDF/model/api/misc/HighContrastColorCombination.java new file mode 100644 index 00000000000..27c6290bbef --- /dev/null +++ b/src/main/java/stirling/software/SPDF/model/api/misc/HighContrastColorCombination.java @@ -0,0 +1,8 @@ +package stirling.software.SPDF.model.api.misc; + +public enum HighContrastColorCombination { + WHITE_TEXT_ON_BLACK, + BLACK_TEXT_ON_WHITE, + YELLOW_TEXT_ON_BLACK, + GREEN_TEXT_ON_BLACK, +} diff --git a/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvert.java b/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvert.java new file mode 100644 index 00000000000..c3acdc56043 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvert.java @@ -0,0 +1,7 @@ +package stirling.software.SPDF.model.api.misc; + +public enum ReplaceAndInvert { + HIGH_CONTRAST_COLOR, + CUSTOM_COLOR, + FULL_INVERSION, +} diff --git a/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvertColorRequest.java b/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvertColorRequest.java new file mode 100644 index 00000000000..1d96d35b262 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/model/api/misc/ReplaceAndInvertColorRequest.java @@ -0,0 +1,40 @@ +package stirling.software.SPDF.model.api.misc; + +import io.swagger.v3.oas.annotations.media.Schema; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import stirling.software.SPDF.model.api.PDFFile; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ReplaceAndInvertColorRequest extends PDFFile { + + @Schema( + description = "Replace and Invert color options of a pdf.", + allowableValues = {"HIGH_CONTRAST_COLOR", "CUSTOM_COLOR", "FULL_INVERSION"}) + private ReplaceAndInvert replaceAndInvertOption; + + @Schema( + description = + "If HIGH_CONTRAST_COLOR option selected, then pick the default color option for text and background.", + allowableValues = { + "WHITE_TEXT_ON_BLACK", + "BLACK_TEXT_ON_WHITE", + "YELLOW_TEXT_ON_BLACK", + "GREEN_TEXT_ON_BLACK" + }) + private HighContrastColorCombination highContrastColorCombination; + + @Schema( + description = + "If CUSTOM_COLOR option selected, then pick the custom color for background. " + + "Expected color value should be 24bit decimal value of a color") + private String backGroundColor; + + @Schema( + description = + "If CUSTOM_COLOR option selected, then pick the custom color for text. " + + "Expected color value should be 24bit decimal value of a color") + private String textColor; +} diff --git a/src/main/java/stirling/software/SPDF/service/misc/ReplaceAndInvertColorService.java b/src/main/java/stirling/software/SPDF/service/misc/ReplaceAndInvertColorService.java new file mode 100644 index 00000000000..29df742a3f5 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/service/misc/ReplaceAndInvertColorService.java @@ -0,0 +1,42 @@ +package stirling.software.SPDF.service.misc; + +import java.io.IOException; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.InputStreamResource; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import stirling.software.SPDF.Factories.ReplaceAndInvertColorFactory; +import stirling.software.SPDF.model.api.misc.HighContrastColorCombination; +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; +import stirling.software.SPDF.utils.misc.ReplaceAndInvertColorStrategy; + +@Service +public class ReplaceAndInvertColorService { + private ReplaceAndInvertColorFactory replaceAndInvertColorFactory; + + @Autowired + public ReplaceAndInvertColorService(ReplaceAndInvertColorFactory replaceAndInvertColorFactory) { + this.replaceAndInvertColorFactory = replaceAndInvertColorFactory; + } + + public InputStreamResource replaceAndInvertColor( + MultipartFile file, + ReplaceAndInvert replaceAndInvertOption, + HighContrastColorCombination highContrastColorCombination, + String backGroundColor, + String textColor) + throws IOException { + + ReplaceAndInvertColorStrategy replaceColorStrategy = + replaceAndInvertColorFactory.replaceAndInvert( + file, + replaceAndInvertOption, + highContrastColorCombination, + backGroundColor, + textColor); + + return replaceColorStrategy.replace(); + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/misc/CustomColorReplaceStrategy.java b/src/main/java/stirling/software/SPDF/utils/misc/CustomColorReplaceStrategy.java new file mode 100644 index 00000000000..3c5753f027f --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/misc/CustomColorReplaceStrategy.java @@ -0,0 +1,163 @@ +package stirling.software.SPDF.utils.misc; + +import java.awt.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.pdmodel.PDPageContentStream; +import org.apache.pdfbox.pdmodel.PDPageTree; +import org.apache.pdfbox.pdmodel.font.*; +import org.apache.pdfbox.text.TextPosition; +import org.springframework.core.io.InputStreamResource; +import org.springframework.web.multipart.MultipartFile; + +import stirling.software.SPDF.model.api.misc.HighContrastColorCombination; +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; + +public class CustomColorReplaceStrategy extends ReplaceAndInvertColorStrategy { + + private String textColor; + private String backgroundColor; + private HighContrastColorCombination highContrastColorCombination; + + public CustomColorReplaceStrategy( + MultipartFile file, + ReplaceAndInvert replaceAndInvert, + String textColor, + String backgroundColor, + HighContrastColorCombination highContrastColorCombination) { + super(file, replaceAndInvert); + this.textColor = textColor; + this.backgroundColor = backgroundColor; + this.highContrastColorCombination = highContrastColorCombination; + } + + @Override + public InputStreamResource replace() throws IOException { + + // If ReplaceAndInvert is HighContrastColor option, then get the colors of text and + // background from static + if (replaceAndInvert == ReplaceAndInvert.HIGH_CONTRAST_COLOR) { + String[] colors = + HighContrastColorReplaceDecider.getColors( + replaceAndInvert, highContrastColorCombination); + this.textColor = colors[0]; + this.backgroundColor = colors[1]; + } + + // Create a temporary file, with the original filename from the multipart file + File file = File.createTempFile("temp", getFileInput().getOriginalFilename()); + + // Transfer the content of the multipart file to the file + getFileInput().transferTo(file); + + try (PDDocument document = Loader.loadPDF(file)) { + + PDPageTree pages = document.getPages(); + + for (PDPage page : pages) { + + PdfTextStripperCustom pdfTextStripperCustom = new PdfTextStripperCustom(); + // Get text positions + List> charactersByArticle = + pdfTextStripperCustom.processPageCustom(page); + + // Begin a new content stream + PDPageContentStream contentStream = + new PDPageContentStream( + document, page, PDPageContentStream.AppendMode.APPEND, true, true); + + // Set the new text color + contentStream.setNonStrokingColor(Color.decode(this.textColor)); + + // Draw the text with the new color + for (List textPositions : charactersByArticle) { + for (TextPosition text : textPositions) { + // Move to the text position + contentStream.beginText(); + contentStream.newLineAtOffset( + text.getX(), page.getMediaBox().getHeight() - text.getY()); + PDFont font = null; + String unicodeText = text.getUnicode(); + try { + font = PDFontFactory.createFont(text.getFont().getCOSObject()); + } catch (IOException io) { + System.out.println("Primary font not found, using fallback font."); + font = new PDType1Font(Standard14Fonts.FontName.HELVETICA); + } + // if a character is not supported by font, then look for supported font + try { + byte[] bytes = font.encode(unicodeText); + } catch (IOException io) { + System.out.println("text could not be encoded "); + font = checkSupportedFontForCharacter(unicodeText); + } catch (IllegalArgumentException ie) { + System.out.println("text not supported by font "); + font = checkSupportedFontForCharacter(unicodeText); + } finally { + // if any other font is not supported, then replace default character * + if (font == null) { + font = new PDType1Font(Standard14Fonts.FontName.HELVETICA); + unicodeText = "*"; + } + } + contentStream.setFont(font, text.getFontSize()); + contentStream.showText(unicodeText); + contentStream.endText(); + } + } + // Close the content stream + contentStream.close(); + // Use a content stream to overlay the background color + try (PDPageContentStream contentStreamBg = + new PDPageContentStream( + document, + page, + PDPageContentStream.AppendMode.PREPEND, + true, + true)) { + // Set background color (e.g., light yellow) + contentStreamBg.setNonStrokingColor(Color.decode(this.backgroundColor)); + contentStreamBg.addRect( + 0, 0, page.getMediaBox().getWidth(), page.getMediaBox().getHeight()); + contentStreamBg.fill(); + } + } + // Save the modified PDF to a ByteArrayOutputStream + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + document.save(byteArrayOutputStream); + document.close(); + + // Prepare the modified PDF for download + ByteArrayInputStream inputStream = + new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); + InputStreamResource resource = new InputStreamResource(inputStream); + return resource; + } + } + + private PDFont checkSupportedFontForCharacter(String unicodeText) { + + Set fonts = Standard14Fonts.getNames(); + for (String font : fonts) { + Standard14Fonts.FontName fontName = Standard14Fonts.getMappedFontName(font); + PDFont currentFont = new PDType1Font(fontName); + try { + byte[] bytes = currentFont.encode(unicodeText); + return currentFont; + } catch (IOException io) { + System.out.println("text could not be encoded "); + } catch (IllegalArgumentException ie) { + System.out.println("text not supported by font "); + } + } + return null; + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/misc/HighContrastColorReplaceDecider.java b/src/main/java/stirling/software/SPDF/utils/misc/HighContrastColorReplaceDecider.java new file mode 100644 index 00000000000..70d226b5555 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/misc/HighContrastColorReplaceDecider.java @@ -0,0 +1,30 @@ +package stirling.software.SPDF.utils.misc; + +import stirling.software.SPDF.model.api.misc.HighContrastColorCombination; +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; + +public class HighContrastColorReplaceDecider { + + // To decide the text and background colors for High contrast color option for replace-invert + // color feature + public static String[] getColors( + ReplaceAndInvert replaceAndInvert, + HighContrastColorCombination highContrastColorCombination) { + + if (highContrastColorCombination == HighContrastColorCombination.BLACK_TEXT_ON_WHITE) { + return new String[] {"0", "16777215"}; + } else if (highContrastColorCombination + == HighContrastColorCombination.GREEN_TEXT_ON_BLACK) { + return new String[] {"65280", "0"}; + } else if (highContrastColorCombination + == HighContrastColorCombination.WHITE_TEXT_ON_BLACK) { + return new String[] {"16777215", "0"}; + } else if (highContrastColorCombination + == HighContrastColorCombination.YELLOW_TEXT_ON_BLACK) { + + return new String[] {"16776960", "0"}; + } + + return null; + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/misc/InvertFullColorStrategy.java b/src/main/java/stirling/software/SPDF/utils/misc/InvertFullColorStrategy.java new file mode 100644 index 00000000000..12cd5204fbf --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/misc/InvertFullColorStrategy.java @@ -0,0 +1,104 @@ +package stirling.software.SPDF.utils.misc; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.pdmodel.PDPageContentStream; +import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; +import org.apache.pdfbox.rendering.PDFRenderer; +import org.springframework.core.io.InputStreamResource; +import org.springframework.web.multipart.MultipartFile; + +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; + +public class InvertFullColorStrategy extends ReplaceAndInvertColorStrategy { + + public InvertFullColorStrategy(MultipartFile file, ReplaceAndInvert replaceAndInvert) { + super(file, replaceAndInvert); + } + + @Override + public InputStreamResource replace() throws IOException { + + // Create a temporary file, with the original filename from the multipart file + File file = File.createTempFile("temp", getFileInput().getOriginalFilename()); + + // Transfer the content of the multipart file to the file + getFileInput().transferTo(file); + + // Load the uploaded PDF + PDDocument document = Loader.loadPDF(file); + + // Render each page and invert colors + PDFRenderer pdfRenderer = new PDFRenderer(document); + for (int page = 0; page < document.getNumberOfPages(); page++) { + BufferedImage image = + pdfRenderer.renderImageWithDPI(page, 300); // Render page at 300 DPI + + // Invert the colors + invertImageColors(image); + + // Create a new PDPage from the inverted image + PDPage pdPage = document.getPage(page); + PDImageXObject pdImage = + PDImageXObject.createFromFileByContent( + convertToBufferedImageTpFile(image), document); + + PDPageContentStream contentStream = + new PDPageContentStream( + document, pdPage, PDPageContentStream.AppendMode.OVERWRITE, true); + contentStream.drawImage( + pdImage, + 0, + 0, + pdPage.getMediaBox().getWidth(), + pdPage.getMediaBox().getHeight()); + contentStream.close(); + } + + // Save the modified PDF to a ByteArrayOutputStream + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + document.save(byteArrayOutputStream); + document.close(); + + // Prepare the modified PDF for download + ByteArrayInputStream inputStream = + new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); + InputStreamResource resource = new InputStreamResource(inputStream); + return resource; + } + + // Method to invert image colors + private void invertImageColors(BufferedImage image) { + int width = image.getWidth(); + int height = image.getHeight(); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + int rgba = image.getRGB(x, y); + Color color = new Color(rgba, true); + Color invertedColor = + new Color( + 255 - color.getRed(), + 255 - color.getGreen(), + 255 - color.getBlue()); + image.setRGB(x, y, invertedColor.getRGB()); + } + } + } + + // Helper method to convert BufferedImage to InputStream + private File convertToBufferedImageTpFile(BufferedImage image) throws IOException { + File file = new File("image.png"); + ImageIO.write(image, "png", file); + return file; + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/misc/PdfTextStripperCustom.java b/src/main/java/stirling/software/SPDF/utils/misc/PdfTextStripperCustom.java new file mode 100644 index 00000000000..291acf5e3f3 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/misc/PdfTextStripperCustom.java @@ -0,0 +1,36 @@ +package stirling.software.SPDF.utils.misc; + +import java.awt.geom.Rectangle2D; +import java.io.IOException; +import java.util.List; + +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.text.PDFTextStripperByArea; +import org.apache.pdfbox.text.TextPosition; + +public class PdfTextStripperCustom extends PDFTextStripperByArea { + + /** + * Constructor. + * + * @throws IOException If there is an error loading properties. + */ + public PdfTextStripperCustom() throws IOException {} + + // To process the page text using stripper and returns the TextPosition and its values + public List> processPageCustom(PDPage page) throws IOException { + + addRegion( + "wholePage", + new Rectangle2D.Float( + page.getMediaBox().getLowerLeftX(), + page.getMediaBox().getLowerLeftY(), + page.getMediaBox().getWidth(), + page.getMediaBox().getHeight())); + extractRegions(page); + + List> textPositions = getCharactersByArticle(); + + return textPositions; + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/misc/ReplaceAndInvertColorStrategy.java b/src/main/java/stirling/software/SPDF/utils/misc/ReplaceAndInvertColorStrategy.java new file mode 100644 index 00000000000..87590731465 --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/misc/ReplaceAndInvertColorStrategy.java @@ -0,0 +1,24 @@ +package stirling.software.SPDF.utils.misc; + +import java.io.IOException; + +import org.springframework.core.io.InputStreamResource; +import org.springframework.web.multipart.MultipartFile; + +import lombok.Data; +import stirling.software.SPDF.model.api.PDFFile; +import stirling.software.SPDF.model.api.misc.ReplaceAndInvert; + +@Data +// @EqualsAndHashCode(callSuper = true) +public abstract class ReplaceAndInvertColorStrategy extends PDFFile { + + protected ReplaceAndInvert replaceAndInvert; + + public ReplaceAndInvertColorStrategy(MultipartFile file, ReplaceAndInvert replaceAndInvert) { + setFileInput(file); + setReplaceAndInvert(replaceAndInvert); + } + + public abstract InputStreamResource replace() throws IOException; +} diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index 284c4353454..19fe9944553 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -76,6 +76,8 @@ donate=تبرع color=لون sponsor=راعٍ info=معلومات +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=إزالة الصورة home.removeImagePdf.desc=إزالة الصورة من PDF لتقليل حجم الملف removeImagePdf.tags=إزالة الصورة,عمليات الصفحة,الخلفية,جانب الخادم +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_bg_BG.properties b/src/main/resources/messages_bg_BG.properties index e6df3a6c83e..2e224ba7494 100644 --- a/src/main/resources/messages_bg_BG.properties +++ b/src/main/resources/messages_bg_BG.properties @@ -76,6 +76,8 @@ donate=Направете дарение color=Цвят sponsor=Спонсор info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index 43647bd8323..48ffcb693cb 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_cs_CZ.properties b/src/main/resources/messages_cs_CZ.properties index dba3c988dce..4f4ec782132 100644 --- a/src/main/resources/messages_cs_CZ.properties +++ b/src/main/resources/messages_cs_CZ.properties @@ -76,6 +76,8 @@ donate=Přispějte color=Barva sponsor=Sponzor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_da_DK.properties b/src/main/resources/messages_da_DK.properties index 4f914d7ede2..7e2c4538d9e 100644 --- a/src/main/resources/messages_da_DK.properties +++ b/src/main/resources/messages_da_DK.properties @@ -76,6 +76,8 @@ donate=Donér color=Farve sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Fjern billede home.removeImagePdf.desc=Fjern billede fra PDF for at reducere filstørrelse removeImagePdf.tags=Fjern Billede,Sideoperationer,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 754745a299b..e156dbf2a0b 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -76,6 +76,8 @@ donate=Spenden color=Farbe sponsor=Sponsor info=Informationen +page=Page +pages=Pages legal.privacy=Datenschutz legal.terms=AGB @@ -480,6 +482,26 @@ home.removeImagePdf.title=Bild entfernen home.removeImagePdf.desc=Bild aus PDF entfernen, um die Dateigröße zu verringern removeImagePdf.tags=bild entfernen,seitenoperationen,back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_el_GR.properties b/src/main/resources/messages_el_GR.properties index c48b8564d31..b19770e0e9b 100644 --- a/src/main/resources/messages_el_GR.properties +++ b/src/main/resources/messages_el_GR.properties @@ -76,6 +76,8 @@ donate=Δωρισε color=Χρώμα sponsor=Yποστηρικτής info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index ecfec8207da..dbebccc0154 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index 027530b2276..6ea5dd95996 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index 7c0e8b0c3d1..5274fc1d2e2 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -76,6 +76,8 @@ donate=Donar color=Color sponsor=Patrocinador info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Eliminar imagen home.removeImagePdf.desc=Eliminar imagen del PDF> para reducir el tamaño de archivo removeImagePdf.tags=Eliminar imagen,Operaciones de página,Back end,lado del servidor +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_eu_ES.properties b/src/main/resources/messages_eu_ES.properties index c8e3b8f3a84..792955c3262 100644 --- a/src/main/resources/messages_eu_ES.properties +++ b/src/main/resources/messages_eu_ES.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 3e78e7a3f70..ee00bb486ad 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -76,6 +76,8 @@ donate=Faire un don color=Couleur sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_ga_IE.properties b/src/main/resources/messages_ga_IE.properties index 07d728165c9..2360538a952 100644 --- a/src/main/resources/messages_ga_IE.properties +++ b/src/main/resources/messages_ga_IE.properties @@ -76,6 +76,8 @@ donate=Síntiúis color=Dath sponsor=Urraitheoir info=Eolas +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_hi_IN.properties b/src/main/resources/messages_hi_IN.properties index 1cda3712826..d93dc2ddec1 100644 --- a/src/main/resources/messages_hi_IN.properties +++ b/src/main/resources/messages_hi_IN.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=पृष्ठ +pages=पृष्ठों legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_hr_HR.properties b/src/main/resources/messages_hr_HR.properties index fd69ac86f58..e8f93b20015 100644 --- a/src/main/resources/messages_hr_HR.properties +++ b/src/main/resources/messages_hr_HR.properties @@ -76,6 +76,8 @@ donate=Doniraj color=Boja sponsor=Sponzor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_hu_HU.properties b/src/main/resources/messages_hu_HU.properties index c2c53163d50..e22cee08c4d 100644 --- a/src/main/resources/messages_hu_HU.properties +++ b/src/main/resources/messages_hu_HU.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_id_ID.properties b/src/main/resources/messages_id_ID.properties index fcf8e5e82d0..cbc0e61a196 100644 --- a/src/main/resources/messages_id_ID.properties +++ b/src/main/resources/messages_id_ID.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index 6355ea65d41..e8fb9fcca38 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -76,6 +76,8 @@ donate=Donazione color=Colore sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Informativa sulla privacy legal.terms=Termini e Condizioni @@ -480,6 +482,26 @@ home.removeImagePdf.title=Rimuovi immagine home.removeImagePdf.desc=Rimuovi le immagini dal PDF per ridurre la dimensione del file removeImagePdf.tags=Rimuovi immagine,operazioni sulla pagina,back-end,lato server +#replace-invert-color +replace-color.title=Sostituisci-Inverti-Colore +replace-color.header=Sostituisci-Inverti colore PDF +home.replaceColorPdf.title=Sostituisci e inverti il colore +home.replaceColorPdf.desc=Sostituisci il colore del testo e dello sfondo nel PDF e inverti il ​​colore completo del PDF per ridurre le dimensioni del file +replaceColorPdf.tags=Sostituisci colore, Operazioni di pagina, Back-end, lato server +replace-color.selectText.1=Sostituisci o inverti le opzioni del colore +replace-color.selectText.2=Predefinito (colori ad alto contrasto predefiniti) +replace-color.selectText.3=Personalizzato (colori personalizzati) +replace-color.selectText.4=Inversione completa (inverte tutti i colori) +replace-color.selectText.5=Opzioni di colore ad alto contrasto +replace-color.selectText.6=testo bianco su sfondo nero +replace-color.selectText.7=Testo nero su sfondo bianco +replace-color.selectText.8=Testo giallo su sfondo nero +replace-color.selectText.9=Testo verde su sfondo nero +replace-color.selectText.10=Scegli il colore del testo +replace-color.selectText.11=Scegli il colore di sfondo +replace-color.submit=Sostituisci + + ########################### # # diff --git a/src/main/resources/messages_ja_JP.properties b/src/main/resources/messages_ja_JP.properties index afb8ff548a7..e5286295d3c 100644 --- a/src/main/resources/messages_ja_JP.properties +++ b/src/main/resources/messages_ja_JP.properties @@ -76,6 +76,8 @@ donate=寄付する color=色 sponsor=スポンサー info=Info +page=Page +pages=Pages legal.privacy=プライバシーポリシー legal.terms=利用規約 @@ -480,6 +482,26 @@ home.removeImagePdf.title=画像の削除 home.removeImagePdf.desc=PDFから画像を削除してファイルサイズを小さくします removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_ko_KR.properties b/src/main/resources/messages_ko_KR.properties index 02d5c3da2f1..43d8f84ec00 100644 --- a/src/main/resources/messages_ko_KR.properties +++ b/src/main/resources/messages_ko_KR.properties @@ -76,6 +76,8 @@ donate=기부하기 color=색상 sponsor=스폰서 info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_nl_NL.properties b/src/main/resources/messages_nl_NL.properties index 391c7e6962d..4d1469d8bc8 100644 --- a/src/main/resources/messages_nl_NL.properties +++ b/src/main/resources/messages_nl_NL.properties @@ -76,6 +76,8 @@ donate=Doneer color=Kleur sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_no_NB.properties b/src/main/resources/messages_no_NB.properties index 1592c3e13ed..abd0738a3a2 100644 --- a/src/main/resources/messages_no_NB.properties +++ b/src/main/resources/messages_no_NB.properties @@ -76,6 +76,8 @@ donate=Doner color=Farge sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_pl_PL.properties b/src/main/resources/messages_pl_PL.properties index 76a98ad3653..c15170cbdcd 100755 --- a/src/main/resources/messages_pl_PL.properties +++ b/src/main/resources/messages_pl_PL.properties @@ -76,6 +76,8 @@ donate=Podaruj color=kolor sponsor=sponsor info=informacje +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_pt_BR.properties b/src/main/resources/messages_pt_BR.properties index 61a6d7fa0a4..b1fc9dee210 100644 --- a/src/main/resources/messages_pt_BR.properties +++ b/src/main/resources/messages_pt_BR.properties @@ -76,6 +76,8 @@ donate=Doar color=Cor sponsor=Patrocine info=Informações +page=Page +pages=Pages legal.privacy=Política de Privacidade legal.terms=Termos e Condições @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remover imagem home.removeImagePdf.desc=Remova a imagem do PDF para reduzir o tamanho do arquivo removeImagePdf.tags=Remover imagem,operações de página,back-end,lado do servidor +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_pt_PT.properties b/src/main/resources/messages_pt_PT.properties index a5f9f48b269..7f6e2956828 100644 --- a/src/main/resources/messages_pt_PT.properties +++ b/src/main/resources/messages_pt_PT.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_ro_RO.properties b/src/main/resources/messages_ro_RO.properties index e035ee7fa9f..f065256d678 100644 --- a/src/main/resources/messages_ro_RO.properties +++ b/src/main/resources/messages_ro_RO.properties @@ -76,6 +76,8 @@ donate=Donează color=Culoare sponsor=Sponsor info=Informații +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Elimină imagine home.removeImagePdf.desc=Elimină imaginea din PDF pentru a reduce dimensiunea fișierului removeImagePdf.tags=Elimină Imagine,Operații pagină,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_ru_RU.properties b/src/main/resources/messages_ru_RU.properties index a4001a498fe..b5db3c478c5 100644 --- a/src/main/resources/messages_ru_RU.properties +++ b/src/main/resources/messages_ru_RU.properties @@ -76,6 +76,8 @@ donate=Пожертвовать color=Цвет sponsor=Спонсор info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_sk_SK.properties b/src/main/resources/messages_sk_SK.properties index 1b9bb358eff..d64aaeaf8ae 100644 --- a/src/main/resources/messages_sk_SK.properties +++ b/src/main/resources/messages_sk_SK.properties @@ -76,6 +76,8 @@ donate=Darovať color=Farba sponsor=Sponzorovať info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_sr_LATN_RS.properties b/src/main/resources/messages_sr_LATN_RS.properties index 900edc0798c..53bb42300a4 100644 --- a/src/main/resources/messages_sr_LATN_RS.properties +++ b/src/main/resources/messages_sr_LATN_RS.properties @@ -76,6 +76,8 @@ donate=Donate color=Color sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_sv_SE.properties b/src/main/resources/messages_sv_SE.properties index d1316494274..a85d294ce91 100644 --- a/src/main/resources/messages_sv_SE.properties +++ b/src/main/resources/messages_sv_SE.properties @@ -76,6 +76,8 @@ donate=Donera color=Färg sponsor=Sponsor info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Ta bort bild home.removeImagePdf.desc=Ta bort bild från PDF för att minska filstorlek removeImagePdf.tags=Ta bort bild,Sidoperationer,Backend,serversida +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_th_TH.properties b/src/main/resources/messages_th_TH.properties index bcccaad86f6..69f93721a52 100644 --- a/src/main/resources/messages_th_TH.properties +++ b/src/main/resources/messages_th_TH.properties @@ -76,6 +76,8 @@ donate=บริจาค color=สี sponsor=ผู้สนับสนุน info=ข้อมูล +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_tr_TR.properties b/src/main/resources/messages_tr_TR.properties index 718271479bd..ad3a5339a39 100644 --- a/src/main/resources/messages_tr_TR.properties +++ b/src/main/resources/messages_tr_TR.properties @@ -76,6 +76,8 @@ donate=Bağış Yapın color=Renk sponsor=Bağış info=Bilgi +page=Page +pages=Pages legal.privacy=Gizlilik Politikası legal.terms=Şartlar ve koşullar @@ -480,6 +482,26 @@ home.removeImagePdf.title=Resmi kaldır home.removeImagePdf.desc=Dosya boyutunu küçültmek için PDF'den resmi kaldırın removeImagePdf.tags=Resmi Kaldır,Sayfa İşlemleri,Arka uç,sunucu tarafı +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_uk_UA.properties b/src/main/resources/messages_uk_UA.properties index 8a06a720fd5..ed35d4e6684 100644 --- a/src/main/resources/messages_uk_UA.properties +++ b/src/main/resources/messages_uk_UA.properties @@ -76,6 +76,8 @@ donate=Задонатити color=Колір sponsor=Спонсор info=Інформація +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_vi_VN.properties b/src/main/resources/messages_vi_VN.properties index 245129e98de..c12a40d530e 100644 --- a/src/main/resources/messages_vi_VN.properties +++ b/src/main/resources/messages_vi_VN.properties @@ -76,6 +76,8 @@ donate=Ủng hộ color=Màu sắc sponsor=Nhà tài trợ info=Thông tin +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_zh_CN.properties b/src/main/resources/messages_zh_CN.properties index 80e9e0cf5b9..4ddf1e87c94 100644 --- a/src/main/resources/messages_zh_CN.properties +++ b/src/main/resources/messages_zh_CN.properties @@ -47,7 +47,7 @@ green=绿色 blue=蓝色 custom=自定义... WorkInProgess=工作正在进行中,可能无法工作或有错误,请报告任何问题! -poweredBy=Powered by +poweredBy=服务来源: yes=是 no=否 changedCredsMessage=凭证已更改! @@ -76,6 +76,8 @@ donate=捐款 color=颜色 sponsor=赞助 info=信息 +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -131,7 +133,7 @@ navbar.sections.edit=查看和编辑 # SETTINGS # ############# settings.title=设置 -settings.update=可更新 +settings.update=有可用的更新 settings.updateAvailable=当前版本为 {0},新版本 ({1}) 可用。 settings.appVersion=应用程序版本: settings.downloadOption.title=选择下载选项(单个文件非压缩文件): @@ -480,6 +482,26 @@ home.removeImagePdf.title=删除图像 home.removeImagePdf.desc=删除图像减少PDF大小 removeImagePdf.tags=删除图像, 页面操作, 后端, 服务端 +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/messages_zh_TW.properties b/src/main/resources/messages_zh_TW.properties index 221e46af413..9e912b554b3 100644 --- a/src/main/resources/messages_zh_TW.properties +++ b/src/main/resources/messages_zh_TW.properties @@ -76,6 +76,8 @@ donate=捐贈 color=顏色 sponsor=贊助 info=Info +page=Page +pages=Pages legal.privacy=Privacy Policy legal.terms=Terms and Conditions @@ -480,6 +482,26 @@ home.removeImagePdf.title=Remove image home.removeImagePdf.desc=Remove image from PDF to reduce file size removeImagePdf.tags=Remove Image,Page operations,Back end,server side +#replace-invert-color +replace-color.title=Replace-Invert-Color +replace-color.header=Replace-Invert Color PDF +home.replaceColorPdf.title=Replace and Invert Color +home.replaceColorPdf.desc=Replace color for text and background in PDF and invert full color of pdf to reduce file size +replaceColorPdf.tags=Replace Color,Page operations,Back end,server side +replace-color.selectText.1=Replace or Invert color Options +replace-color.selectText.2=Default(Default high contrast colors) +replace-color.selectText.3=Custom(Customized colors) +replace-color.selectText.4=Full-Invert(Invert all colors) +replace-color.selectText.5=High contrast color options +replace-color.selectText.6=white text on black background +replace-color.selectText.7=Black text on white background +replace-color.selectText.8=Yellow text on black background +replace-color.selectText.9=Green text on black background +replace-color.selectText.10=Choose text Color +replace-color.selectText.11=Choose background Color +replace-color.submit=Replace + + ########################### # # diff --git a/src/main/resources/static/css/navbar.css b/src/main/resources/static/css/navbar.css index 96255e0c8a3..7db824628c3 100644 --- a/src/main/resources/static/css/navbar.css +++ b/src/main/resources/static/css/navbar.css @@ -7,8 +7,8 @@ } #navbarSearch.show { - max-height: 300px; - /* Adjust this to your desired max height */ + height: auto; + /*dynamically changes height*/ } #searchResults .dropdown-item { @@ -268,6 +268,7 @@ span.icon-text::after { /* Dropdown min-width */ .dropdown-mw-28 { min-width: 280px; + min-height: 50px; } .dropdown-mw-20 { @@ -314,6 +315,7 @@ span.icon-text::after { display: block; margin-top: 0; } + .icon-hide { display: none; } diff --git a/src/main/resources/static/js/merge.js b/src/main/resources/static/js/merge.js index 55575727701..41d1fe1ebef 100644 --- a/src/main/resources/static/js/merge.js +++ b/src/main/resources/static/js/merge.js @@ -11,7 +11,7 @@ document.getElementById("fileInput-input").addEventListener("change", function ( /** * @param {FileList} files */ -function displayFiles(files) { +async function displayFiles(files) { const list = document.getElementById("selectedFiles"); while (list.firstChild) { @@ -19,11 +19,16 @@ function displayFiles(files) { } for (let i = 0; i < files.length; i++) { + const pageCount = await getPDFPageCount(files[i]); + const pageLabel = pageCount === 1 ? pageTranslation : pagesTranslation; const item = document.createElement("li"); item.className = "list-group-item"; item.innerHTML = `
${files[i].name}
+
+ ${pageCount} ${pageLabel} +
@@ -37,6 +42,13 @@ function displayFiles(files) { attachMoveButtons(); } +async function getPDFPageCount(file) { + const blobUrl = URL.createObjectURL(file); + const pdf = await pdfjsLib.getDocument(blobUrl).promise; + URL.revokeObjectURL(blobUrl); + return pdf.numPages; +} + function attachMoveButtons() { var moveUpButtons = document.querySelectorAll(".move-up"); for (var i = 0; i < moveUpButtons.length; i++) { diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index b852569d7d5..fe0c8842d30 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -198,6 +198,9 @@
+
+
diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index f8f85440ce2..7f448f7a67f 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -248,11 +248,15 @@
+
+
+
+
+
-
diff --git a/src/main/resources/templates/merge-pdfs.html b/src/main/resources/templates/merge-pdfs.html index 8e1e0fbce25..8a874788c82 100644 --- a/src/main/resources/templates/merge-pdfs.html +++ b/src/main/resources/templates/merge-pdfs.html @@ -1,46 +1,63 @@ - - + + + - - + + - -
-
- -

-
-
-
-
- add_to_photos - -
-
-
- -
-
-
- - -
-
-
    -
    -
    - - - -
    -
    - + +
    +
    + +

    +
    +
    +
    +
    + add_to_photos +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
      +
      +
      + + + +
      +
      + + + + + +
      -
      - - + +
      + + + \ No newline at end of file diff --git a/src/main/resources/templates/misc/replace-color.html b/src/main/resources/templates/misc/replace-color.html new file mode 100644 index 00000000000..4defcff7258 --- /dev/null +++ b/src/main/resources/templates/misc/replace-color.html @@ -0,0 +1,89 @@ + + + + + + + + + +
      +
      + +

      +
      +
      +
      +
      + zoom_in_map + +
      +
      +
      +
      +
      +
      +

      + +
      +
      + + + + + +
      +
      +
      +
      +
      + +
      + + + + \ No newline at end of file