From c311f9a4ed4a61b2e50fe66c400ad3cca9a73eaa Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sun, 16 Apr 2023 22:03:30 +0100 Subject: [PATCH] Convert PDF to Docx, powerpoint and others (#90) --- README.md | 7 +- build.gradle | 11 +- .../SPDF/controller/MergeController.java | 4 - .../SPDF/controller/OCRController.java | 5 +- .../SPDF/controller/SplitPDFController.java | 10 +- .../converters/ConvertOfficeController.java | 6 +- .../converters/ConvertPDFToOffice.java | 97 +++++++++++++++++ .../converters/ConvertPDFToPDFA.java | 5 - .../security/WatermarkController.java | 2 +- .../software/SPDF/utils/PDFToFile.java | 101 ++++++++++++++++++ .../software/SPDF/utils/ProcessExecutor.java | 2 +- src/main/resources/messages_ar_AR.properties | 46 ++++++++ src/main/resources/messages_de_DE.properties | 45 +++++++- src/main/resources/messages_en_GB.properties | 51 +++++++-- src/main/resources/messages_es_ES.properties | 47 ++++++++ src/main/resources/messages_fr_FR.properties | 52 ++++++++- .../templates/convert/pdf-to-html.html | 28 +++++ .../convert/pdf-to-presentation.html | 37 +++++++ .../templates/convert/pdf-to-text.html | 34 ++++++ .../templates/convert/pdf-to-word.html | 40 +++++++ .../templates/convert/pdf-to-xml.html | 28 +++++ .../resources/templates/fragments/navbar.html | 13 ++- src/main/resources/templates/home.html | 9 ++ 23 files changed, 633 insertions(+), 47 deletions(-) create mode 100644 src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToOffice.java create mode 100644 src/main/java/stirling/software/SPDF/utils/PDFToFile.java create mode 100644 src/main/resources/templates/convert/pdf-to-html.html create mode 100644 src/main/resources/templates/convert/pdf-to-presentation.html create mode 100644 src/main/resources/templates/convert/pdf-to-text.html create mode 100644 src/main/resources/templates/convert/pdf-to-word.html create mode 100644 src/main/resources/templates/convert/pdf-to-xml.html diff --git a/README.md b/README.md index 32aac87a..719cc8ae 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,9 @@ [![GitHub Repo stars](https://img.shields.io/github/stars/frooodle/stirling-pdf?style=social)](https://github.com/Frooodle/stirling-pdf) [![Paypal Donate](https://img.shields.io/badge/Paypal%20Donate-yellow?style=flat&logo=paypal)](https://www.paypal.com/paypalme/froodleplex) -This is a locally hosted web application that allows you to perform various operations on PDF files, such as splitting and adding images. +This is a powerful locally hosted web based PDF manipulation tool using docker that allows you to perform various operations on PDF files, such as splitting merging, converting, reorganizing, adding images, rotating, compressing, and more. This locally hosted web application started as a 100% ChatGPT-made application and has evolved to include a wide range of features to handle all your PDF needs. -Started off as a 100% ChatGPT made application, slowly moving away from that as more features are added - -I will support and fix/add things to this if there is a demand [Discord](https://discord.gg/Cn8pWhQRxZ) +Feel free to request any features of bug fixes either in github issues or our [Discord](https://discord.gg/Cn8pWhQRxZ) ![stirling-home](images/stirling-home.png) @@ -29,6 +27,7 @@ I will support and fix/add things to this if there is a demand [Discord](https:/ - Set PDF Permissions - Add watermark(s) - Convert Any common file to PDF (using LibreOffice) +- Convert PDF to Word/Powerpoint/Others (using LibreOffice) - Extract images from PDF - OCR on PDF (Using OCRMyPDF) - Edit metadata diff --git a/build.gradle b/build.gradle index ac6d7df2..92810392 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'stirling.software' -version = '0.4.8' +version = '0.5.0' sourceCompatibility = '17' repositories { @@ -13,12 +13,9 @@ repositories { } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - - implementation 'org.apache.logging.log4j:log4j-core:2.20.0' - + implementation 'org.springframework.boot:spring-boot-starter-web:3.0.5' + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.0.5' + testImplementation 'org.springframework.boot:spring-boot-starter-test:3.0.5' // https://mvnrepository.com/artifact/org.apache.pdfbox/jbig2-imageio implementation group: 'org.apache.pdfbox', name: 'jbig2-imageio', version: '3.0.4' implementation 'commons-io:commons-io:2.11.0' diff --git a/src/main/java/stirling/software/SPDF/controller/MergeController.java b/src/main/java/stirling/software/SPDF/controller/MergeController.java index b7fb02d5..b07cf668 100644 --- a/src/main/java/stirling/software/SPDF/controller/MergeController.java +++ b/src/main/java/stirling/software/SPDF/controller/MergeController.java @@ -1,7 +1,5 @@ package stirling.software.SPDF.controller; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -11,8 +9,6 @@ import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPageTree; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.core.io.InputStreamResource; -import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; diff --git a/src/main/java/stirling/software/SPDF/controller/OCRController.java b/src/main/java/stirling/software/SPDF/controller/OCRController.java index 3713cbda..98f2767f 100644 --- a/src/main/java/stirling/software/SPDF/controller/OCRController.java +++ b/src/main/java/stirling/software/SPDF/controller/OCRController.java @@ -5,12 +5,12 @@ import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -28,9 +28,6 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import stirling.software.SPDF.utils.ProcessExecutor; -//import com.spire.pdf.*; -import java.util.concurrent.Semaphore; -import java.util.regex.Pattern; @Controller public class OCRController { diff --git a/src/main/java/stirling/software/SPDF/controller/SplitPDFController.java b/src/main/java/stirling/software/SPDF/controller/SplitPDFController.java index e456d89b..05b00399 100644 --- a/src/main/java/stirling/software/SPDF/controller/SplitPDFController.java +++ b/src/main/java/stirling/software/SPDF/controller/SplitPDFController.java @@ -3,18 +3,14 @@ package stirling.software.SPDF.controller; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; -import java.nio.file.FileSystem; -import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; @@ -31,8 +27,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; @Controller public class SplitPDFController { diff --git a/src/main/java/stirling/software/SPDF/controller/converters/ConvertOfficeController.java b/src/main/java/stirling/software/SPDF/controller/converters/ConvertOfficeController.java index ab2106aa..794ffd80 100644 --- a/src/main/java/stirling/software/SPDF/controller/converters/ConvertOfficeController.java +++ b/src/main/java/stirling/software/SPDF/controller/converters/ConvertOfficeController.java @@ -1,13 +1,14 @@ package stirling.software.SPDF.controller.converters; import java.io.IOException; -import java.nio.file.StandardCopyOption; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.apache.commons.io.FilenameUtils; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -15,7 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; -import org.apache.commons.io.FilenameUtils; + import stirling.software.SPDF.utils.PdfUtils; import stirling.software.SPDF.utils.ProcessExecutor; @Controller @@ -75,4 +76,5 @@ private boolean isValidFileExtension(String fileExtension) { String extensionPattern = "^(?i)[a-z0-9]{2,4}$"; return fileExtension.matches(extensionPattern); } + } diff --git a/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToOffice.java b/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToOffice.java new file mode 100644 index 00000000..d07846fa --- /dev/null +++ b/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToOffice.java @@ -0,0 +1,97 @@ +package stirling.software.SPDF.controller.converters; + +import java.io.IOException; + +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.ModelAndView; + +import stirling.software.SPDF.utils.PDFToFile; + +@Controller +public class ConvertPDFToOffice { + + + + @GetMapping("/pdf-to-word") + public ModelAndView pdfToWord() { + ModelAndView modelAndView = new ModelAndView("convert/pdf-to-word"); + modelAndView.addObject("currentPage", "pdf-to-word"); + return modelAndView; + } + + @GetMapping("/pdf-to-presentation") + public ModelAndView pdfToPresentation() { + ModelAndView modelAndView = new ModelAndView("convert/pdf-to-presentation"); + modelAndView.addObject("currentPage", "pdf-to-presentation"); + return modelAndView; + } + + @GetMapping("/pdf-to-text") + public ModelAndView pdfToText() { + ModelAndView modelAndView = new ModelAndView("convert/pdf-to-text"); + modelAndView.addObject("currentPage", "pdf-to-text"); + return modelAndView; + } + + @GetMapping("/pdf-to-html") + public ModelAndView pdfToHTML() { + ModelAndView modelAndView = new ModelAndView("convert/pdf-to-html"); + modelAndView.addObject("currentPage", "pdf-to-html"); + return modelAndView; + } + + @GetMapping("/pdf-to-xml") + public ModelAndView pdfToXML() { + ModelAndView modelAndView = new ModelAndView("convert/pdf-to-xml"); + modelAndView.addObject("currentPage", "pdf-to-xml"); + return modelAndView; + } + + + @PostMapping("/pdf-to-word") + public ResponseEntity processPdfToWord(@RequestParam("fileInput") MultipartFile inputFile, + @RequestParam("outputFormat") String outputFormat) throws IOException, InterruptedException { + PDFToFile pdfToFile = new PDFToFile(); + return pdfToFile.processPdfToOfficeFormat(inputFile, outputFormat, "writer_pdf_import"); + } + + @PostMapping("/pdf-to-presentation") + public ResponseEntity processPdfToPresentation(@RequestParam("fileInput") MultipartFile inputFile, + @RequestParam("outputFormat") String outputFormat) throws IOException, InterruptedException { + PDFToFile pdfToFile = new PDFToFile(); + return pdfToFile.processPdfToOfficeFormat(inputFile, outputFormat, "impress_pdf_import"); + } + + @PostMapping("/pdf-to-text") + public ResponseEntity processPdfToRTForTXT(@RequestParam("fileInput") MultipartFile inputFile, + @RequestParam("outputFormat") String outputFormat) throws IOException, InterruptedException { + PDFToFile pdfToFile = new PDFToFile(); + return pdfToFile.processPdfToOfficeFormat(inputFile, outputFormat, "writer_pdf_import"); + } + + + @PostMapping("/pdf-to-html") + public ResponseEntity processPdfToHTML(@RequestParam("fileInput") MultipartFile inputFile) throws IOException, InterruptedException { + PDFToFile pdfToFile = new PDFToFile(); + return pdfToFile.processPdfToOfficeFormat(inputFile, "html", "writer_pdf_import"); + } + + @PostMapping("/pdf-to-xml") + public ResponseEntity processPdfToXML(@RequestParam("fileInput") MultipartFile inputFile) throws IOException, InterruptedException { + PDFToFile pdfToFile = new PDFToFile(); + return pdfToFile.processPdfToOfficeFormat(inputFile, "xml", "writer_pdf_import"); + } + + + + + + + + +} diff --git a/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToPDFA.java b/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToPDFA.java index 9f648d4c..3c8319c9 100644 --- a/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToPDFA.java +++ b/src/main/java/stirling/software/SPDF/controller/converters/ConvertPDFToPDFA.java @@ -1,11 +1,9 @@ package stirling.software.SPDF.controller.converters; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.springframework.http.HttpHeaders; @@ -18,9 +16,6 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; -import com.itextpdf.xmp.XMPException; - -import stirling.software.SPDF.utils.PdfUtils; import stirling.software.SPDF.utils.ProcessExecutor; @Controller public class ConvertPDFToPDFA { diff --git a/src/main/java/stirling/software/SPDF/controller/security/WatermarkController.java b/src/main/java/stirling/software/SPDF/controller/security/WatermarkController.java index ea518c30..78c9011d 100644 --- a/src/main/java/stirling/software/SPDF/controller/security/WatermarkController.java +++ b/src/main/java/stirling/software/SPDF/controller/security/WatermarkController.java @@ -11,6 +11,7 @@ import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPageContentStream; import org.apache.pdfbox.pdmodel.font.PDFont; import org.apache.pdfbox.pdmodel.font.PDType1Font; +import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState; import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup; import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm; @@ -26,7 +27,6 @@ import org.springframework.web.multipart.MultipartFile; import stirling.software.SPDF.utils.PdfUtils; import stirling.software.SPDF.utils.WatermarkRemover; -import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState; @Controller public class WatermarkController { diff --git a/src/main/java/stirling/software/SPDF/utils/PDFToFile.java b/src/main/java/stirling/software/SPDF/utils/PDFToFile.java new file mode 100644 index 00000000..7821d47c --- /dev/null +++ b/src/main/java/stirling/software/SPDF/utils/PDFToFile.java @@ -0,0 +1,101 @@ +package stirling.software.SPDF.utils; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.multipart.MultipartFile; +public class PDFToFile { + public ResponseEntity processPdfToOfficeFormat(MultipartFile inputFile, String outputFormat, String libreOfficeFilter) + throws IOException, InterruptedException { + + if (!"application/pdf".equals(inputFile.getContentType())) { + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + + // Get the original PDF file name without the extension + String originalPdfFileName = inputFile.getOriginalFilename(); + String pdfBaseName = originalPdfFileName.substring(0, originalPdfFileName.lastIndexOf('.')); + + // Validate output format + List allowedFormats = Arrays.asList("doc", "docx", "odt", "ppt", "pptx", "odp", "rtf", "html","xml","txt:Text"); + if (!allowedFormats.contains(outputFormat)) { + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + + Path tempInputFile = null; + Path tempOutputDir = null; + byte[] fileBytes; + // Prepare response + HttpHeaders headers = new HttpHeaders(); + + try { + // Save the uploaded file to a temporary location + tempInputFile = Files.createTempFile("input_", ".pdf"); + Files.copy(inputFile.getInputStream(), tempInputFile, StandardCopyOption.REPLACE_EXISTING); + + // Prepare the output directory + tempOutputDir = Files.createTempDirectory("output_"); + + // Run the LibreOffice command + List command = new ArrayList<>(Arrays.asList( + "soffice", "--infilter=" + libreOfficeFilter, "--convert-to", outputFormat, "--outdir", tempOutputDir.toString(), tempInputFile.toString() + )); + int returnCode = ProcessExecutor.getInstance(ProcessExecutor.Processes.LIBRE_OFFICE).runCommandWithOutputHandling(command); + + // Get output files + List outputFiles = Arrays.asList(tempOutputDir.toFile().listFiles()); + + if (outputFiles.size() == 1) { + // Return single output file + File outputFile = outputFiles.get(0); + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); + if(outputFormat.equals("txt:Text")) { + outputFormat="txt"; + } + headers.setContentDispositionFormData("attachment", pdfBaseName + "." + outputFormat); + fileBytes = FileUtils.readFileToByteArray(outputFile); + } else { + // Return output files in a ZIP archive + headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); + headers.setContentDispositionFormData("attachment", pdfBaseName + "To" + outputFormat + ".zip"); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream); + + for (File outputFile : outputFiles) { + ZipEntry entry = new ZipEntry(outputFile.getName()); + zipOutputStream.putNextEntry(entry); + FileInputStream fis = new FileInputStream(outputFile); + IOUtils.copy(fis, zipOutputStream); + fis.close(); + zipOutputStream.closeEntry(); + } + + zipOutputStream.close(); + fileBytes = byteArrayOutputStream.toByteArray(); + } + + } finally { + // Clean up the temporary files + if (tempInputFile != null) + Files.delete(tempInputFile); + if (tempOutputDir != null) + FileUtils.deleteDirectory(tempOutputDir.toFile()); + } + return new ResponseEntity<>(fileBytes, headers, HttpStatus.OK); + } +} diff --git a/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java b/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java index 70a018fa..8e9065c9 100644 --- a/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java +++ b/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java @@ -1,13 +1,13 @@ package stirling.software.SPDF.utils; import java.io.BufferedReader; -import java.util.concurrent.ConcurrentHashMap; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Semaphore; public class ProcessExecutor { diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index 4912c3ef..99e138e7 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -91,6 +91,21 @@ home.pdfToPDFA.title = \u062A\u062D\u0648\u064A\u0644 \u0645\u0644\u0641\u0627\u home.pdfToPDFA.desc = \u062A\u062D\u0648\u064A\u0644 PDF \u0625\u0644\u0649 PDF / A \u0644\u0644\u062A\u062E\u0632\u064A\u0646 \u0637\u0648\u064A\u0644 \u0627\u0644\u0645\u062F\u0649 +home.PDFToWord.title = تحويل PDF إلى Word +home.PDFToWord.desc = تحويل PDF إلى تنسيقات Word (DOC و DOCX و ODT) + +home.PDFToPresentation.title = PDF للعرض التقديمي +home.PDFToPresentation.desc = تحويل PDF إلى تنسيقات عرض تقديمي (PPT و PPTX و ODP) + +home.PDFToText.title = تحويل PDF إلى نص / RTF +home.PDFToText.desc = تحويل PDF إلى تنسيق نص أو RTF + +home.PDFToHTML.title = تحويل PDF إلى HTML +home.PDFToHTML.desc = تحويل PDF إلى تنسيق HTML + +home.PDFToXML.title = تحويل PDF إلى XML +home.PDFToXML.desc = تحويل PDF إلى تنسيق XML + navbar.settings=\u0625\u0639\u062F\u0627\u062F\u0627\u062A settings.title=\u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A settings.update=\u0627\u0644\u062A\u062D\u062F\u064A\u062B \u0645\u062A\u0627\u062D @@ -305,3 +320,34 @@ pdfToPDFA.title=PDF \u0625\u0644\u0649 PDF / A pdfToPDFA.header=PDF \u0625\u0644\u0649 PDF / A pdfToPDFA.credit=\u062A\u0633\u062A\u062E\u062F\u0645 \u0647\u0630\u0647 \u0627\u0644\u062E\u062F\u0645\u0629 OCRmyPDF \u0644\u062A\u062D\u0648\u064A\u0644 PDF / A. pdfToPDFA.submit=\u062A\u062D\u0648\u064A\u0644 + + +PDFToWord.title = تحويل PDF إلى Word +PDFToWord.header = تحويل PDF إلى Word +PDFToWord.selectText.1 = تنسيق ملف الإخراج +PDFToWord.credit = تستخدم هذه الخدمة LibreOffice لتحويل الملفات. +PDFToWord.submit = تحويل + +PDFToPresentation.title = PDF للعرض التقديمي +PDFToPresentation.header = PDF للعرض التقديمي +PDFToPresentation.selectText.1 = تنسيق ملف الإخراج +PDFToPresentation.credit = تستخدم هذه الخدمة LibreOffice لتحويل الملف. +PDFToPresentation.submit = تحويل + + +PDFToText.title = تحويل PDF إلى نص / RTF +PDFToText.header = تحويل PDF إلى نص / RTF +PDFToText.selectText.1 = تنسيق ملف الإخراج +PDFToText.credit = تستخدم هذه الخدمة LibreOffice لتحويل الملفات. +PDFToText.submit = تحويل + + +PDFToHTML.title = PDF إلى HTML +PDFToHTML.header = PDF إلى HTML +PDFToHTML.credit = تستخدم هذه الخدمة LibreOffice لتحويل الملفات. +PDFToHTML.submit = تحويل + +PDFToXML.title = تحويل PDF إلى XML +PDFToXML.header = تحويل PDF إلى XML +PDFToXML.credit = تستخدم هذه الخدمة LibreOffice لتحويل الملفات. +PDFToXML.submit = تحويل diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 534a4635..1d0f9386 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -85,6 +85,21 @@ home.extractImages.desc=Extrahiert alle Bilder aus einer PDF-Datei und speichert home.pdfToPDFA.title=PDF zu PDF/A konvertieren home.pdfToPDFA.desc=PDF zu PDF/A für Langzeitarchivierung konvertieren +home.PDFToWord.title=PDF zu Word +home.PDFToWord.desc=PDF in Word-Formate konvertieren (DOC, DOCX und ODT) + +home.PDFToPresentation.title=PDF zu Präsentation +home.PDFToPresentation.desc=PDF in Präsentationsformate konvertieren (PPT, PPTX und ODP) + +home.PDFToText.title=PDF in Text/RTF +home.PDFToText.desc=PDF in Text- oder RTF-Format konvertieren + +home.PDFToHTML.title=PDF in HTML +home.PDFToHTML.desc=PDF in HTML-Format konvertieren + +home.PDFToXML.title=PDF in XML +home.PDFToXML.desc=PDF in XML-Format konvertieren + navbar.settings=Einstellungen settings.title=Einstellungen @@ -311,7 +326,35 @@ pdfToPDFA.submit=Konvertieren - +PDFToWord.title=PDF zu Word +PDFToWord.header=PDF zu Word +PDFToWord.selectText.1=Ausgabedateiformat +PDFToWord.credit=Dieser Dienst verwendet LibreOffice für die Dateikonvertierung. +PDFToWord.submit=Konvertieren + +PDFToPresentation.title=PDF zu Präsentation +PDFToPresentation.header=PDF zu Präsentation +PDFToPresentation.selectText.1=Ausgabedateiformat +PDFToPresentation.credit=Dieser Dienst verwendet LibreOffice für die Dateikonvertierung. +PDFToPresentation.submit=Konvertieren + + +PDFToText.title=PDF in Text/RTF +PDFToText.header=PDF in Text/RTF +PDFToText.selectText.1=Ausgabedateiformat +PDFToText.credit=Dieser Dienst verwendet LibreOffice für die Dateikonvertierung. +PDFToText.submit=Konvertieren + + +PDFToHTML.title=PDF in HTML +PDFToHTML.header=PDF in HTML +PDFToHTML.credit=Dieser Dienst verwendet LibreOffice für die Dateikonvertierung. +PDFToHTML.submit=Konvertieren + +PDFToXML.title=PDF in XML +PDFToXML.header=PDF in XML +PDFToXML.credit=Dieser Dienst verwendet LibreOffice für die Dateikonvertierung. +PDFToXML.submit=Konvertieren diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 02838112..88921dbb 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -85,6 +85,22 @@ home.extractImages.desc=Extracts all images from a PDF and saves them to zip home.pdfToPDFA.title=Convert PDF to PDF/A home.pdfToPDFA.desc=Convert PDF to PDF/A for long-term storage +home.PDFToWord.title=PDF to Word +home.PDFToWord.desc=Convert PDF to Word formats (DOC, DOCX and ODT) + +home.PDFToPresentation.title=PDF to Presentation +home.PDFToPresentation.desc=Convert PDF to Presentation formats (PPT, PPTX and ODP) + +home.PDFToText.title=PDF to Text/RTF +home.PDFToText.desc=Convert PDF to Text or RTF format + +home.PDFToHTML.title=PDF to HTML +home.PDFToHTML.desc=Convert PDF to HTML format + +home.PDFToXML.title=PDF to XML +home.PDFToXML.desc=Convert PDF to XML format + + navbar.settings=Settings settings.title=Settings @@ -310,12 +326,35 @@ pdfToPDFA.submit=Convert - - - - - - +PDFToWord.title=PDF to Word +PDFToWord.header=PDF to Word +PDFToWord.selectText.1=Output file format +PDFToWord.credit=This service uses LibreOffice for file conversion. +PDFToWord.submit=Convert + +PDFToPresentation.title=PDF to Presentation +PDFToPresentation.header=PDF to Presentation +PDFToPresentation.selectText.1=Output file format +PDFToPresentation.credit=This service uses LibreOffice for file conversion. +PDFToPresentation.submit=Convert + + +PDFToText.title=PDF to Text/RTF +PDFToText.header=PDF to Text/RTF +PDFToText.selectText.1=Output file format +PDFToText.credit=This service uses LibreOffice for file conversion. +PDFToText.submit=Convert + + +PDFToHTML.title=PDF to HTML +PDFToHTML.header=PDF to HTML +PDFToHTML.credit=This service uses LibreOffice for file conversion. +PDFToHTML.submit=Convert + +PDFToXML.title=PDF to XML +PDFToXML.header=PDF to XML +PDFToXML.credit=This service uses LibreOffice for file conversion. +PDFToXML.submit=Convert diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index a334e844..62453994 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -85,6 +85,21 @@ home.extractImages.desc=Extrae todas las imágenes de un PDF y las guarda en zip home.pdfToPDFA.title=Convierte PDF to PDF/A home.pdfToPDFA.desc=Convierte PDF to PDF/A para almacenamiento a largo plazo +home.PDFToWord.title=PDF a Word +home.PDFToWord.desc=Convertir formatos PDF a Word (DOC, DOCX y ODT) + +home.PDFToPresentation.title=PDF a presentacin +home.PDFToPresentation.desc=Convertir PDF a formatos de presentacin (PPT, PPTX y ODP) + +home.PDFToText.title=PDF a texto/RTF +home.PDFToText.desc=Convertir PDF a texto o formato RTF + +home.PDFToHTML.title=PDF a HTML +home.PDFToHTML.desc=Convertir PDF a formato HTML + +home.PDFToXML.title=PDF a XML +home.PDFToXML.desc=Convertir PDF a formato XML + navbar.settings=Ajustes settings.title=Ajustes @@ -307,3 +322,35 @@ pdfToPDFA.title=PDF a PDF/A pdfToPDFA.header=PDF a PDF/A pdfToPDFA.credit=Este servicio usa OCRmyPDF para la conversión a PDF/A pdfToPDFA.submit=Convertir + + + +PDFToWord.title=PDF a Word +PDFToWord.header=PDF a Word +PDFToWord.selectText.1=Formato de archivo de salida +PDFToWord.credit=Este servicio utiliza LibreOffice para la conversin de archivos. +PDFToWord.submit=Convertir + +PDFToPresentation.title=PDF a presentacin +PDFToPresentation.header=PDF a presentacin +PDFToPresentation.selectText.1=Formato de archivo de salida +PDFToPresentation.credit=Este servicio utiliza LibreOffice para la conversin de archivos. +PDFToPresentation.submit=Convertir + + +PDFToText.title=PDF a texto/RTF +PDFToText.header=PDF a texto/RTF +PDFToText.selectText.1=Formato de archivo de salida +PDFToText.credit=Este servicio utiliza LibreOffice para la conversin de archivos. +PDFToText.submit=Convertir + + +PDFToHTML.title=PDF a HTML +PDFToHTML.header=PDF a HTML +PDFToHTML.credit=Este servicio utiliza LibreOffice para la conversin de archivos. +PDFToHTML.submit=Convertir + +PDFToXML.title=PDF a XML +PDFToXML.header=PDF a XML +PDFToXML.credit=Este servicio utiliza LibreOffice para la conversin de archivos. +PDFToXML.submit=Convertir diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 46ec91c3..f238e2a7 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -91,6 +91,21 @@ home.extractImages.desc=Extrait toutes les images d\u2019un PDF et les enregistr home.pdfToPDFA.title=Convertir PDF en PDF/A home.pdfToPDFA.desc=Convertir un PDF en PDF/A pour un stockage à long terme +home.PDFToWord.title=PDF vers Word +home.PDFToWord.desc=Convertir les formats PDF en Word (DOC, DOCX et ODT) + +home.PDFToPresentation.title=PDF vers présentation +home.PDFToPresentation.desc=Convertir des PDF en formats de présentation (PPT, PPTX et ODP) + +home.PDFToText.title=PDF vers texte/RTF +home.PDFToText.desc=Convertir un PDF au format Texte ou RTF + +home.PDFToHTML.title=PDF vers HTML +home.PDFToHTML.desc=Convertir le PDF au format HTML + +home.PDFToXML.title=PDF vers XML +home.PDFToXML.desc=Convertir le PDF au format XML + navbar.settings=Paramètres settings.title=Paramètres settings.update=Mise à jour disponible @@ -302,4 +317,39 @@ xlsToPdf.convert=Convertir pdfToPDFA.title=PDF vers PDF/A pdfToPDFA.header=PDF vers PDF/A pdfToPDFA.credit=Ce service utilise OCRmyPDF pour la conversion PDF/A -pdfToPDFA.submit=Convertir \ No newline at end of file +pdfToPDFA.submit=Convertir + + + + +PDFToWord.title=PDF vers Word +PDFToWord.header=PDF vers Word +PDFToWord.selectText.1=Format du fichier de sortie +PDFToWord.credit=Ce service utilise LibreOffice pour la conversion de fichiers. +PDFToWord.submit=Convertir + +PDFToPresentation.title=PDF vers présentation +PDFToPresentation.header=PDF vers présentation +PDFToPresentation.selectText.1=Format du fichier de sortie +PDFToPresentation.credit=Ce service utilise LibreOffice pour la conversion de fichiers. +PDFToPresentation.submit=Convertir + + +PDFToText.title=PDF vers Texte/RTF +PDFToText.header=PDF vers texte/RTF +PDFToText.selectText.1=Format du fichier de sortie +PDFToText.credit=Ce service utilise LibreOffice pour la conversion de fichiers. +PDFToText.submit=Convertir + + +PDFToHTML.title=PDF vers HTML +PDFToHTML.header=PDF vers HTML +PDFToHTML.credit=Ce service utilise LibreOffice pour la conversion de fichiers. +PDFToHTML.submit=Convertir + +PDFToXML.title=PDF vers XML +PDFToXML.header=PDF vers XML +PDFToXML.credit=Ce service utilise LibreOffice pour la conversion de fichiers. +PDFToXML.submit=Convertir + + diff --git a/src/main/resources/templates/convert/pdf-to-html.html b/src/main/resources/templates/convert/pdf-to-html.html new file mode 100644 index 00000000..1fe4bec9 --- /dev/null +++ b/src/main/resources/templates/convert/pdf-to-html.html @@ -0,0 +1,28 @@ + + + + + +
+
+
+

+
+
+
+

+
+
+
+ + +
+

+
+
+
+
+
+
+ + diff --git a/src/main/resources/templates/convert/pdf-to-presentation.html b/src/main/resources/templates/convert/pdf-to-presentation.html new file mode 100644 index 00000000..ea99e2a0 --- /dev/null +++ b/src/main/resources/templates/convert/pdf-to-presentation.html @@ -0,0 +1,37 @@ + + + + + +
+
+
+

+
+
+
+

+
+
+ +
+ + +
+
+ + +
+

+
+
+
+
+
+
+ + diff --git a/src/main/resources/templates/convert/pdf-to-text.html b/src/main/resources/templates/convert/pdf-to-text.html new file mode 100644 index 00000000..007ec547 --- /dev/null +++ b/src/main/resources/templates/convert/pdf-to-text.html @@ -0,0 +1,34 @@ + + + + + +
+
+
+

+
+
+
+

+
+
+ +
+ + +
+
+ + +
+

+
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/resources/templates/convert/pdf-to-word.html b/src/main/resources/templates/convert/pdf-to-word.html new file mode 100644 index 00000000..50abafe4 --- /dev/null +++ b/src/main/resources/templates/convert/pdf-to-word.html @@ -0,0 +1,40 @@ + + + + + +
+
+
+

+
+
+
+

+
+
+ +
+ + +
+
+ + +
+

+
+
+
+
+
+
+ + + + + diff --git a/src/main/resources/templates/convert/pdf-to-xml.html b/src/main/resources/templates/convert/pdf-to-xml.html new file mode 100644 index 00000000..5ec23f2d --- /dev/null +++ b/src/main/resources/templates/convert/pdf-to-xml.html @@ -0,0 +1,28 @@ + + + + + +
+
+
+

+
+
+
+

+
+
+
+ + +
+

+
+
+
+
+
+
+ + diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index f2d9f202..94cc9472 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -96,16 +96,23 @@ function compareVersions(version1, version2) { - +