Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c311f9a4ed | ||
|
|
0a7517ecdd | ||
|
|
03febd9484 | ||
|
|
655b97bfd5 | ||
|
|
fdbc7f4621 | ||
|
|
f9fe303671 |
44
Dockerfile
44
Dockerfile
@@ -1,47 +1,5 @@
|
||||
# Build jbig2enc in a separate stage
|
||||
FROM debian:bullseye-slim as jbig2enc_builder
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
automake \
|
||||
autoconf \
|
||||
libtool \
|
||||
libleptonica-dev \
|
||||
pkg-config \
|
||||
ca-certificates \
|
||||
zlib1g-dev \
|
||||
make \
|
||||
g++
|
||||
|
||||
RUN git clone https://github.com/agl/jbig2enc && \
|
||||
cd jbig2enc && \
|
||||
./autogen.sh && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
# Main stage
|
||||
FROM openjdk:17-jdk-slim
|
||||
|
||||
# Install necessary dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
libreoffice-core \
|
||||
libreoffice-common \
|
||||
libreoffice-writer \
|
||||
libreoffice-calc \
|
||||
libreoffice-impress \
|
||||
python3-uno \
|
||||
python3-pip \
|
||||
unoconv \
|
||||
pngquant \
|
||||
unpaper \
|
||||
ocrmypdf && \
|
||||
pip install --user --upgrade ocrmypdf
|
||||
|
||||
# Copy the jbig2enc binary from the builder stage
|
||||
COPY --from=jbig2enc_builder /usr/local/bin/jbig2 /usr/local/bin/jbig2
|
||||
FROM frooodle/stirling-pdf-base:latest
|
||||
|
||||
# Copy the application JAR file
|
||||
COPY build/libs/*.jar app.jar
|
||||
|
||||
44
DockerfileBase
Normal file
44
DockerfileBase
Normal file
@@ -0,0 +1,44 @@
|
||||
# Build jbig2enc in a separate stage
|
||||
FROM debian:bullseye-slim as jbig2enc_builder
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
automake \
|
||||
autoconf \
|
||||
libtool \
|
||||
libleptonica-dev \
|
||||
pkg-config \
|
||||
ca-certificates \
|
||||
zlib1g-dev \
|
||||
make \
|
||||
g++
|
||||
|
||||
RUN git clone https://github.com/agl/jbig2enc && \
|
||||
cd jbig2enc && \
|
||||
./autogen.sh && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
# Main stage
|
||||
FROM openjdk:17-jdk-slim
|
||||
|
||||
# Install necessary dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
libreoffice-core \
|
||||
libreoffice-common \
|
||||
libreoffice-writer \
|
||||
libreoffice-calc \
|
||||
libreoffice-impress \
|
||||
python3-uno \
|
||||
python3-pip \
|
||||
unoconv \
|
||||
pngquant \
|
||||
unpaper \
|
||||
ocrmypdf && \
|
||||
pip install --user --upgrade ocrmypdf
|
||||
|
||||
# Copy the jbig2enc binary from the builder stage
|
||||
COPY --from=jbig2enc_builder /usr/local/bin/jbig2 /usr/local/bin/jbig2
|
||||
@@ -7,11 +7,9 @@
|
||||
[](https://github.com/Frooodle/stirling-pdf)
|
||||
[](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)
|
||||
|
||||
|
||||

|
||||
@@ -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
|
||||
|
||||
13
build.gradle
13
build.gradle
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'stirling.software'
|
||||
version = '0.4.7'
|
||||
version = '0.5.0'
|
||||
sourceCompatibility = '17'
|
||||
|
||||
repositories {
|
||||
@@ -13,15 +13,12 @@ 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'
|
||||
|
||||
//general PDF
|
||||
implementation 'org.apache.pdfbox:pdfbox:2.0.27'
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,11 +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;
|
||||
@@ -27,8 +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;
|
||||
@Controller
|
||||
public class OCRController {
|
||||
|
||||
@@ -41,8 +40,6 @@ public class OCRController {
|
||||
modelAndView.addObject("currentPage", "ocr-pdf");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
private final Semaphore semaphore = new Semaphore(2);
|
||||
|
||||
@PostMapping("/ocr-pdf")
|
||||
public ResponseEntity<byte[]> processPdfWithOCR(@RequestParam("fileInput") MultipartFile inputFile,
|
||||
@@ -59,9 +56,19 @@ public class OCRController {
|
||||
throw new IOException("Please select at least one language.");
|
||||
}
|
||||
|
||||
// Validate and sanitize selected languages using regex
|
||||
String languagePattern = "^[a-zA-Z]{3}$"; // Regex pattern for three-letter language codes
|
||||
selectedLanguages = selectedLanguages.stream()
|
||||
.filter(lang -> Pattern.matches(languagePattern, lang))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
if (selectedLanguages.isEmpty()) {
|
||||
throw new IOException("None of the selected languages are valid.");
|
||||
}
|
||||
// Save the uploaded file to a temporary location
|
||||
Path tempInputFile = Files.createTempFile("input_", ".pdf");
|
||||
inputFile.transferTo(tempInputFile.toFile());
|
||||
Files.copy(inputFile.getInputStream(), tempInputFile, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
// Prepare the output file path
|
||||
Path tempOutputFile = Files.createTempFile("output_", ".pdf");
|
||||
|
||||
@@ -28,11 +28,11 @@ public class OverlayImageController {
|
||||
|
||||
@PostMapping("/add-image")
|
||||
public ResponseEntity<byte[]> overlayImage(@RequestParam("fileInput") MultipartFile pdfFile, @RequestParam("fileInput2") MultipartFile imageFile, @RequestParam("x") float x,
|
||||
@RequestParam("y") float y) {
|
||||
@RequestParam("y") float y, @RequestParam("everyPage") boolean everyPage) {
|
||||
try {
|
||||
byte[] pdfBytes = pdfFile.getBytes();
|
||||
byte[] imageBytes = imageFile.getBytes();
|
||||
byte[] result = PdfUtils.overlayImage(pdfBytes, imageBytes, x, y);
|
||||
byte[] result = PdfUtils.overlayImage(pdfBytes, imageBytes, x, y, everyPage);
|
||||
|
||||
return PdfUtils.bytesToWebResponse(result, pdfFile.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_overlayed.pdf");
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@ package stirling.software.SPDF.controller.converters;
|
||||
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 org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -39,14 +41,20 @@ public class ConvertOfficeController {
|
||||
|
||||
|
||||
public byte[] convertToPdf(MultipartFile inputFile) throws IOException, InterruptedException {
|
||||
// Check for valid file extension
|
||||
String originalFilename = inputFile.getOriginalFilename();
|
||||
if (originalFilename == null || !isValidFileExtension(FilenameUtils.getExtension(originalFilename))) {
|
||||
throw new IllegalArgumentException("Invalid file extension");
|
||||
}
|
||||
|
||||
// Save the uploaded file to a temporary location
|
||||
Path tempInputFile = Files.createTempFile("input_", "." + getFileExtension(inputFile.getOriginalFilename()));
|
||||
inputFile.transferTo(tempInputFile.toFile());
|
||||
Path tempInputFile = Files.createTempFile("input_", "." + FilenameUtils.getExtension(originalFilename));
|
||||
Files.copy(inputFile.getInputStream(), tempInputFile, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
// Prepare the output file path
|
||||
Path tempOutputFile = Files.createTempFile("output_", ".pdf");
|
||||
|
||||
// Run the LibreOffice command
|
||||
// Run the LibreOffice command
|
||||
List<String> command = new ArrayList<>(Arrays.asList("unoconv", "-vvv",
|
||||
"-f",
|
||||
"pdf",
|
||||
@@ -64,14 +72,9 @@ public byte[] convertToPdf(MultipartFile inputFile) throws IOException, Interrup
|
||||
|
||||
return pdfBytes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String getFileExtension(String fileName) {
|
||||
int dotIndex = fileName.lastIndexOf('.');
|
||||
if (dotIndex == -1) {
|
||||
return "";
|
||||
}
|
||||
return fileName.substring(dotIndex + 1);
|
||||
private boolean isValidFileExtension(String fileExtension) {
|
||||
String extensionPattern = "^(?i)[a-z0-9]{2,4}$";
|
||||
return fileExtension.matches(extensionPattern);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> 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<byte[]> processPdfToXML(@RequestParam("fileInput") MultipartFile inputFile) throws IOException, InterruptedException {
|
||||
PDFToFile pdfToFile = new PDFToFile();
|
||||
return pdfToFile.processPdfToOfficeFormat(inputFile, "xml", "writer_pdf_import");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
101
src/main/java/stirling/software/SPDF/utils/PDFToFile.java
Normal file
101
src/main/java/stirling/software/SPDF/utils/PDFToFile.java
Normal file
@@ -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<byte[]> 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<String> 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<String> 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<File> 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);
|
||||
}
|
||||
}
|
||||
@@ -188,29 +188,36 @@ public class PdfUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] overlayImage(byte[] pdfBytes, byte[] imageBytes, float x, float y) throws IOException {
|
||||
public static byte[] overlayImage(byte[] pdfBytes, byte[] imageBytes, float x, float y, boolean everyPage) throws IOException {
|
||||
|
||||
PDDocument document = PDDocument.load(new ByteArrayInputStream(pdfBytes));
|
||||
|
||||
try (PDDocument document = PDDocument.load(new ByteArrayInputStream(pdfBytes))) {
|
||||
// Get the first page of the PDF
|
||||
PDPage page = document.getPage(0);
|
||||
try (PDPageContentStream contentStream = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.APPEND, true)) {
|
||||
// Create an image object from the image bytes
|
||||
PDImageXObject image = PDImageXObject.createFromByteArray(document, imageBytes, "");
|
||||
// Draw the image onto the page at the specified x and y coordinates
|
||||
contentStream.drawImage(image, x, y);
|
||||
logger.info("Image successfully overlayed onto PDF");
|
||||
int pages = document.getNumberOfPages();
|
||||
for (int i = 0; i < pages; i++) {
|
||||
PDPage page = document.getPage(i);
|
||||
try (PDPageContentStream contentStream = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.APPEND, true)) {
|
||||
// Create an image object from the image bytes
|
||||
PDImageXObject image = PDImageXObject.createFromByteArray(document, imageBytes, "");
|
||||
// Draw the image onto the page at the specified x and y coordinates
|
||||
contentStream.drawImage(image, x, y);
|
||||
logger.info("Image successfully overlayed onto PDF");
|
||||
if (everyPage == false && i == 0) {
|
||||
break;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Log an error message if there is an issue overlaying the image onto the PDF
|
||||
logger.error("Error overlaying image onto PDF", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
// Create a ByteArrayOutputStream to save the PDF to
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
document.save(baos);
|
||||
logger.info("PDF successfully saved to byte array");
|
||||
return baos.toByteArray();
|
||||
} catch (IOException e) {
|
||||
// Log an error message if there is an issue overlaying the image onto the PDF
|
||||
logger.error("Error overlaying image onto PDF", e);
|
||||
throw e;
|
||||
// Create a ByteArrayOutputStream to save the PDF to
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
document.save(baos);
|
||||
logger.info("PDF successfully saved to byte array");
|
||||
return baos.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static ResponseEntity<byte[]> iTextDocToWebResponse(Document document, String docName) throws IOException, DocumentException {
|
||||
// Close the document
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -135,6 +150,7 @@ fileToPDF.submit=\u062A\u062D\u0648\u064A\u0644 \u0625\u0644\u0649 PDF
|
||||
#Add image
|
||||
addImage.title=إضافة صورة
|
||||
addImage.header=إضافة صورة إلى PDF (العمل قيد التقدم)
|
||||
addImage.everyPage=كل صفحة؟
|
||||
addImage.submit=إضافة صورة
|
||||
|
||||
#compress
|
||||
@@ -304,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 = تحويل
|
||||
|
||||
@@ -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
|
||||
@@ -134,6 +149,7 @@ fileToPDF.submit=In PDF konvertieren
|
||||
#Add image
|
||||
addImage.title=Bild hinzufügen
|
||||
addImage.header=Ein Bild einfügen (Work in progress)
|
||||
addImage.everyPage=Jede Seite?
|
||||
addImage.submit=Bild hinzufügen
|
||||
|
||||
#compress
|
||||
@@ -310,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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -149,6 +165,7 @@ compress.submit=Compress
|
||||
#Add image
|
||||
addImage.title=Add Image
|
||||
addImage.header=Add image to PDF (Work in progress)
|
||||
addImage.everyPage=Every Page?
|
||||
addImage.submit=Add image
|
||||
|
||||
|
||||
@@ -309,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
|
||||
|
||||
|
||||
|
||||
|
||||
356
src/main/resources/messages_es_ES.properties
Normal file
356
src/main/resources/messages_es_ES.properties
Normal file
@@ -0,0 +1,356 @@
|
||||
###########
|
||||
# Generic #
|
||||
###########
|
||||
# the direction that the language is written (ltr = left to right, rtl = right to left)
|
||||
language.direction=ltr
|
||||
|
||||
pdfPrompt=Selecciona PDF(s)
|
||||
multiPdfPrompt=Selecciona PDFs (2+)
|
||||
multiPdfDropPrompt=Selecciona (o arrastra y suelta) todos los PDFs que quieras
|
||||
imgPrompt=Selecciona Imagen(es)
|
||||
genericSubmit=Enviar
|
||||
processTimeWarning=Advertencia: este proceso puede tardar hasta un minuto dependiendo del tamaño del archivo
|
||||
pageOrderPrompt=Orden de páginas (Introduzca una lista de números de página separados por coma):
|
||||
goToPage=Ir
|
||||
true=Verdadero
|
||||
false=Falso
|
||||
unknown=Desconocido
|
||||
save=Guardar
|
||||
close=Cerrar
|
||||
|
||||
#############
|
||||
# HOME-PAGE #
|
||||
#############
|
||||
home.desc=Tu autohospedada ventanilla única para todas tus necesidades PDF.
|
||||
|
||||
navbar.convert=Convertir
|
||||
navbar.security=Seguridad
|
||||
navbar.other=Otro
|
||||
navbar.darkmode=Modo oscuro
|
||||
|
||||
home.merge.title=Une PDFs
|
||||
home.merge.desc=Unir fácilmente múltiples PDFs en uno.
|
||||
|
||||
home.split.title=Divide PDFs
|
||||
home.split.desc=Divide PDFs en múltiples documentos
|
||||
|
||||
home.rotate.title=Rota PDFs
|
||||
home.rotate.desc=Rota fácilmente tus PDFs.
|
||||
|
||||
home.imageToPdf.title=Imagen a PDF
|
||||
home.imageToPdf.desc=Convierte una imagen (PNG, JPEG, GIF) a PDF.
|
||||
|
||||
home.pdfToImage.title=PDF a Imagen
|
||||
home.pdfToImage.desc=Convierte un PDF a una imagen. (PNG, JPEG, GIF)
|
||||
|
||||
home.pdfOrganiser.title=Organizador PDF
|
||||
home.pdfOrganiser.desc=Elimina/Reorganiza páginas en cualquier orden
|
||||
|
||||
home.addImage.title=Agregar imagen al PDF
|
||||
home.addImage.desc=Agrega una imagen en una ubicación establecida en el PDF (trabajo en progreso)
|
||||
|
||||
home.watermark.title=Añade marca de agua
|
||||
home.watermark.desc=Añade una marca de agua predefinida a tu documento PDF.
|
||||
|
||||
home.remove-watermark.title=Elimina marca de agua
|
||||
home.remove-watermark.desc=Elimina marcas de agua de tu documento PDF.
|
||||
|
||||
home.permissions.title=Cambia Permisos
|
||||
home.permissions.desc=Cambia los permisos de tu documento PDF
|
||||
|
||||
home.removePages.title=Elimina Páginas
|
||||
home.removePages.desc=Elimina páginas no deseadas de tu documento PDF.
|
||||
|
||||
home.addPassword.title=Añade Contraseña
|
||||
home.addPassword.desc=Encripta tu documento PDF con una contraseña.
|
||||
|
||||
home.removePassword.title=Elimina Contraseña
|
||||
home.removePassword.desc=Elimina la contraseña de tu documento PDF.
|
||||
|
||||
home.compressPdfs.title=Comprime PDFs
|
||||
home.compressPdfs.desc=Comprime PDFs para reducir el tamaño del fichero.
|
||||
|
||||
home.changeMetadata.title=Cambia Metadatos
|
||||
home.changeMetadata.desc=Cambia/Elimina/Añade metadatos a tu documento PDF.
|
||||
|
||||
home.fileToPDF.title=Convierte fichero a PDF
|
||||
home.fileToPDF.desc=Convierte casi cualquier archivo a PDF (DOCX, PNG, XLS, PPT, TXT y más)
|
||||
|
||||
home.ocr.title=Ejecute OCR en PDF y/o escaneos de limpieza
|
||||
home.ocr.desc=Escaneos de limpieza y detecta texto de imágenes dentro de un PDF y lo vuelve a agregar como texto.
|
||||
|
||||
home.extractImages.title=Extraer imágenes
|
||||
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 presentación
|
||||
home.PDFToPresentation.desc=Convertir PDF a formatos de presentación (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
|
||||
settings.update=Actualización disponible
|
||||
settings.appVersion=Version de la aplicacion:
|
||||
settings.downloadOption.title=Elija la opción de descarga (para descargas de un solo archivo sin zip):
|
||||
settings.downloadOption.1=Abre en la misma ventana
|
||||
settings.downloadOption.2=Abre en una nueva ventana
|
||||
settings.downloadOption.3=Descarga el fichero
|
||||
settings.zipThreshold=Ficheros Zip cuando excede el número de ficheros descargados
|
||||
|
||||
|
||||
|
||||
|
||||
#OCR
|
||||
ocr.title=OCR / Escaneo de limpieza
|
||||
ocr.header=Escaneos de limpieza / OCR (Reconocimiento óptico de caracteres)
|
||||
ocr.SeleccionaText.1=Selecciona los idiomas que se detectarán en el PDF (Los enumerados son los detectados actualmente):
|
||||
ocr.SeleccionaText.2=Produzca un archivo de texto que contenga texto OCR junto con el PDF editado con OCR
|
||||
ocr.SeleccionaText.3=Corrija las páginas que se escanearon en un ángulo torcido girándolas nuevamente a su lugar
|
||||
ocr.SeleccionaText.4=Limpie la página para que sea menos probable que el OCR encuentre texto en el ruido de fondo. (Sin cambio de salida)
|
||||
ocr.SeleccionaText.5=Limpie la página para que sea menos probable que el OCR encuentre texto en el ruido de fondo, mantiene la limpieza en la salida.
|
||||
ocr.SeleccionaText.6=Ignora las páginas que tienen texto interactivo, solo las páginas OCR que son imágenes
|
||||
ocr.SeleccionaText.7=Fuerza OCR, OCR eliminará en cada página todo el texto original
|
||||
ocr.SeleccionaText.8=Normal (Se producirá un error si el PDF contiene texto)
|
||||
ocr.SeleccionaText.9=Ajustes Adicionales
|
||||
ocr.SeleccionaText.10=Modo OCR
|
||||
ocr.help=Lea esta documentación sobre cómo usar esto para otros idiomas y/o no usarlo en docker
|
||||
ocr.credit=Este servicio utiliza OCRmyPDF y Tesseract para OCR.
|
||||
ocr.submit=Procesa PDF con OCR
|
||||
|
||||
|
||||
|
||||
extractImages.title=Extraer imágenes
|
||||
extractImages.header=Extraer imágenes
|
||||
extractImages.SeleccionaText=Selecciona el formato de imagen para convertir las imágenes extraÃdas
|
||||
extractImages.submit=Extraer
|
||||
|
||||
|
||||
#File to PDF
|
||||
fileToPDF.title=Fichero a PDF
|
||||
fileToPDF.header=Convierte cualquier fichero a PDF
|
||||
fileToPDF.credit=Este servicio usa LibreOffice y Unoconv para la conversión de ficheros.
|
||||
fileToPDF.supportedFileTypes=Los tipos de ficheros soportados deben incluir los de abajo sin embargo para una completa y acutualizada lista de formatos soportados, por favor consulte la documentación de LibreOffice
|
||||
fileToPDF.submit=Convertir a PDF
|
||||
|
||||
|
||||
#compress
|
||||
compress.title=Comprimir
|
||||
compress.header=Comprimir PDF
|
||||
compress.credit=Este servicio usa OCRmyPDF para la Compresión/Optimizatión del PDF.
|
||||
compress.SeleccionaText.1=Nivel de Optimización:
|
||||
compress.SeleccionaText.2=0 (Sin optimización)
|
||||
compress.SeleccionaText.3=1 (Por defecto, optimización sin pérdidas)
|
||||
compress.SeleccionaText.4=2 (Optimización con pérdida)
|
||||
compress.SeleccionaText.5=3 (Optimización con pérdida, más agresiva)
|
||||
compress.SeleccionaText.6=Habilita la vista web rápida (linealizar PDF)
|
||||
compress.SeleccionaText.7=Habilita la codificación JBIG2 con pérdida
|
||||
compress.submit=Comprimir
|
||||
|
||||
|
||||
#Add image
|
||||
addImage.title=Añade Imagen
|
||||
addImage.header=Añade image de PDF (Trabajo en progreso)
|
||||
addImage.everyPage=¿Todas las páginas?
|
||||
addImage.submit=Añade imagen
|
||||
|
||||
|
||||
#merge
|
||||
merge.title=Mezcla
|
||||
merge.header=Mezcla múltiples PDFs (2+)
|
||||
merge.submit=Mezcla
|
||||
|
||||
#pdfOrganiser
|
||||
pdfOrganiser.title=Organizador de páginas
|
||||
pdfOrganiser.header=Organizador de páginas PDF
|
||||
pdfOrganiser.submit=Organiza páginas
|
||||
|
||||
|
||||
#pageRemover
|
||||
pageRemover.title=Eliminador de páginas
|
||||
pageRemover.header=Eliminador de páginas PDF
|
||||
pageRemover.pagesToDelete=Páginas a eliminar (Introduzca una lista de números de página separados por coma):
|
||||
pageRemover.submit=Elimina Páginas
|
||||
|
||||
#rotate
|
||||
rotate.title=Rotar PDF
|
||||
rotate.header=Rotar PDF
|
||||
rotate.SeleccionaAngle=Selecciona ángulo de rotación (múltiple de 90 grados):
|
||||
rotate.submit=Rotar
|
||||
|
||||
|
||||
|
||||
|
||||
#merge
|
||||
split.title=Dividir PDF
|
||||
split.header=Dividir PDF
|
||||
split.desc.1=Los números que selecciona son el número de página en el que desea hacer una división
|
||||
split.desc.2=Como tal, seleccionar 1,3,7-8 dividirÃa un documento de 10 páginas en 6 archivos PDF separados con:
|
||||
split.desc.3=Documento #1: Page 1
|
||||
split.desc.4=Documento #2: Page 2 and 3
|
||||
split.desc.5=Documento #3: Page 4, 5 and 6
|
||||
split.desc.6=Documento #4: Page 7
|
||||
split.desc.7=Documento #5: Page 8
|
||||
split.desc.8=Documento #6: Page 9 and 10
|
||||
split.splitPages=Introduzca las páginas para dividir en:
|
||||
split.submit=Dividir
|
||||
|
||||
|
||||
#merge
|
||||
imageToPDF.title=Imagen a PDF
|
||||
imageToPDF.header=Imagen a PDF
|
||||
imageToPDF.submit=Convertir
|
||||
imageToPDF.SeleccionaText.1=Estirar para ajustar
|
||||
imageToPDF.SeleccionaText.2=Auto rotación PDF
|
||||
imageToPDF.SeleccionaText.3=Lógica de archivos múltiples (Únicamente activado si funciona con multiples imágenes)
|
||||
imageToPDF.SeleccionaText.4=Une en un único PDF
|
||||
imageToPDF.SeleccionaText.5=Convertir a PDFs separados
|
||||
|
||||
#pdfToImage
|
||||
pdfToImage.title=PDF a Imagen
|
||||
pdfToImage.header=PDF a Imagen
|
||||
pdfToImage.SeleccionaText=Formato de Imagen
|
||||
pdfToImage.singleOrMultiple=Tipo resultante de imagen
|
||||
pdfToImage.single=Imagen Grande Única
|
||||
pdfToImage.multi=Múltiples Imágenes
|
||||
pdfToImage.colorType=Tipo de color
|
||||
pdfToImage.color=Color
|
||||
pdfToImage.grey=Escala de Grises
|
||||
pdfToImage.blackwhite=Blanco y Negro (¡Puedes perder datos!)
|
||||
pdfToImage.submit=Convertir
|
||||
|
||||
#addPassword
|
||||
addPassword.title=Añade Contraseña
|
||||
addPassword.header=Añade contraseña (Encripta)
|
||||
addPassword.SeleccionaText.1=Selecciona PDF para encriptar
|
||||
addPassword.SeleccionaText.2=Contraseña
|
||||
addPassword.SeleccionaText.3=Longitud de la clave de cifrado
|
||||
addPassword.SeleccionaText.4=Valores altos son más fuertes, pero valores bajos tienen mejor compatibilidad.
|
||||
addPassword.SeleccionaText.5=Permisos para establecer
|
||||
addPassword.SeleccionaText.6=Impedir el ensamblaje del documento
|
||||
addPassword.SeleccionaText.7=Impedir la extracción de contenido
|
||||
addPassword.SeleccionaText.8=Impedir la extracción para la accesibilidad
|
||||
addPassword.SeleccionaText.9=Impedir rellenar formulario
|
||||
addPassword.SeleccionaText.10=Impedir modificación
|
||||
addPassword.SeleccionaText.11=Impedir modificación de anotaciones
|
||||
addPassword.SeleccionaText.12=Impedir imprimir
|
||||
addPassword.SeleccionaText.13=Impedir imprimir diferentes formatos
|
||||
addPassword.submit=Encripta
|
||||
|
||||
#watermark
|
||||
watermark.title=Añade marca de agua
|
||||
watermark.header=Añade marca de agua
|
||||
watermark.SeleccionaText.1=Selecciona PDF para añadir marca de agua:
|
||||
watermark.SeleccionaText.2=Texto de la marca de agua:
|
||||
watermark.SeleccionaText.3=Tamaño de la Fuente:
|
||||
watermark.SeleccionaText.4=Rotación (0-360):
|
||||
watermark.SeleccionaText.5=Ancho (Espacio entre cada marca de agua horizontalmente):
|
||||
watermark.SeleccionaText.6=Alto (Espacio entre cada marca de agua verticalmente):
|
||||
watermark.SeleccionaText.7=Opacidad (0% - 100%):
|
||||
watermark.submit=Añade marca de agua
|
||||
|
||||
#remove-watermark
|
||||
remove-watermark.title=Elimina marca de agua
|
||||
remove-watermark.header=Elimina marca de agua
|
||||
remove-watermark.SeleccionaText.1=Selecciona PDF para eliminar la marca de agua:
|
||||
remove-watermark.SeleccionaText.2=Texto de la marca de agua:
|
||||
remove-watermark.submit=Elimina marca de agua
|
||||
|
||||
#Change permissions
|
||||
permissions.title=Cambiar Permisos
|
||||
permissions.header=Cambiar Permisos
|
||||
permissions.warning=Advertencia para que estos permisos no se puedan cambiar, se recomienda configurarlos con una contraseña a través de la página de cambio de contraseña
|
||||
permissions.SeleccionaText.1=Selecciona PDF para cambiar los permisos
|
||||
permissions.SeleccionaText.2=Permisos a establecer
|
||||
permissions.SeleccionaText.3=Impedir el ensamblaje del documento
|
||||
permissions.SeleccionaText.4=Impedir la extracción de contenido
|
||||
permissions.SeleccionaText.5=Impedir la extracción para la accesibilidad
|
||||
permissions.SeleccionaText.6=Impedir rellenar formulario
|
||||
permissions.SeleccionaText.7=Impedir modificación
|
||||
permissions.SeleccionaText.8=Impedir modificación de anotaciones
|
||||
permissions.SeleccionaText.9=Impedir imprimir
|
||||
permissions.SeleccionaText.10=Impedir imprimir diferentes formatos
|
||||
permissions.submit=Cambiar
|
||||
|
||||
#remove password
|
||||
removePassword.title=Elimina contraseña
|
||||
removePassword.header=Elimina contraseña (Desencripta)
|
||||
removePassword.SeleccionaText.1=Selecciona PDF para Desencriptar
|
||||
removePassword.SeleccionaText.2=Contraseña
|
||||
removePassword.submit=Elimina
|
||||
|
||||
changeMetadata.title=Cambia Metadatos
|
||||
changeMetadata.header=Cambia Metadatos
|
||||
changeMetadata.SeleccionaText.1=Edite las variables que desea cambiar
|
||||
changeMetadata.SeleccionaText.2=Elimina todos los metadatos
|
||||
changeMetadata.SeleccionaText.3=Mostrar metadatos personalizados:
|
||||
changeMetadata.author=Autor:
|
||||
changeMetadata.creationDate=Fecha de Creación (yyyy/MM/dd HH:mm:ss):
|
||||
changeMetadata.creator=Creador:
|
||||
changeMetadata.keywords=Palabras clave:
|
||||
changeMetadata.modDate=Fecha de Modificación (yyyy/MM/dd HH:mm:ss):
|
||||
changeMetadata.producer=Productor:
|
||||
changeMetadata.subject=Asunto:
|
||||
changeMetadata.title=TÃtulo:
|
||||
changeMetadata.trapped=Trapped:
|
||||
changeMetadata.SeleccionaText.4=Otros Metadatos:
|
||||
changeMetadata.SeleccionaText.5=Agregar entrada de metadatos personalizados
|
||||
changeMetadata.submit=Cambia
|
||||
|
||||
xlsToPdf.title=Excel a PDF
|
||||
xlsToPdf.header=Excel a PDF
|
||||
xlsToPdf.SeleccionaText.1=Selecciona hoja de cálculo de Excel XLS o XLSX para convertir
|
||||
xlsToPdf.convert=convertir
|
||||
|
||||
|
||||
|
||||
|
||||
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 conversión de archivos.
|
||||
PDFToWord.submit=Convertir
|
||||
|
||||
PDFToPresentation.title=PDF a presentación
|
||||
PDFToPresentation.header=PDF a presentación
|
||||
PDFToPresentation.selectText.1=Formato de archivo de salida
|
||||
PDFToPresentation.credit=Este servicio utiliza LibreOffice para la conversión 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 conversión de archivos.
|
||||
PDFToText.submit=Convertir
|
||||
|
||||
|
||||
PDFToHTML.title=PDF a HTML
|
||||
PDFToHTML.header=PDF a HTML
|
||||
PDFToHTML.credit=Este servicio utiliza LibreOffice para la conversión de archivos.
|
||||
PDFToHTML.submit=Convertir
|
||||
|
||||
PDFToXML.title=PDF a XML
|
||||
PDFToXML.header=PDF a XML
|
||||
PDFToXML.credit=Este servicio utiliza LibreOffice para la conversión de archivos.
|
||||
PDFToXML.submit=Convertir
|
||||
@@ -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
|
||||
@@ -137,6 +152,7 @@ fileToPDF.submit=Convertir en PDF
|
||||
#Add image
|
||||
addImage.title=Ajouter une image
|
||||
addImage.header=Ajouter une image au PDF (Travail en cours)
|
||||
addImage.everyPage=Chaque page?
|
||||
addImage.submit=Ajouter une image
|
||||
|
||||
#compress
|
||||
@@ -301,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
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -23,4 +23,5 @@ body {
|
||||
}
|
||||
#support-section {
|
||||
background-color: #444 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
<div class="form-group">
|
||||
<label for="y">Y</label> <input type="number" class="form-control" id="y" name="y" step="0.01" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" id="everyPage" name="everyPage" value="true"> <label for="everyPage" th:text="#{addImage.everyPage}"></label>
|
||||
</div>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{addImage.submit}"></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
28
src/main/resources/templates/convert/pdf-to-html.html
Normal file
28
src/main/resources/templates/convert/pdf-to-html.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:insert="~{fragments/common :: head(title=#{PDFToHTML.title})}"></th:block>
|
||||
<body>
|
||||
<div id="page-container">
|
||||
<div id="content-wrap">
|
||||
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
||||
<br> <br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2 th:text="#{PDFToHTML.header}"></h2>
|
||||
<form method="post" enctype="multipart/form-data" th:action="@{pdf-to-html}">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
||||
<br>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToHTML.submit}"></button>
|
||||
|
||||
</form>
|
||||
<p class="mt-3" th:text="#{PDFToHTML.credit}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:insert="~{fragments/common :: head(title=#{PDFToPresentation.title})}"></th:block>
|
||||
<body>
|
||||
<div id="page-container">
|
||||
<div id="content-wrap">
|
||||
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
||||
<br> <br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2 th:text="#{PDFToPresentation.header}"></h2>
|
||||
<form method="post" enctype="multipart/form-data" th:action="@{pdf-to-presentation}">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label th:text="#{PDFToPresentation.selectText.1}"></label>
|
||||
<select class="form-control" name="outputFormat">
|
||||
<option value="ppt">PPT</option>
|
||||
<option value="pptx">PPTX</option>
|
||||
<option value="odp">ODP</option>
|
||||
</select>
|
||||
</div>
|
||||
<br>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToPresentation.submit}"></button>
|
||||
|
||||
</form>
|
||||
<p class="mt-3" th:text="#{PDFToPresentation.credit}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
34
src/main/resources/templates/convert/pdf-to-text.html
Normal file
34
src/main/resources/templates/convert/pdf-to-text.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:insert="~{fragments/common :: head(title=#{PDFToText.title})}"></th:block>
|
||||
<body>
|
||||
<div id="page-container">
|
||||
<div id="content-wrap">
|
||||
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
||||
<br> <br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2 th:text="#{PDFToText.header}"></h2>
|
||||
<form method="post" enctype="multipart/form-data" th:action="@{pdf-to-text}">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label th:text="#{PDFToText.selectText.1}"></label>
|
||||
<select class="form-control" name="outputFormat">
|
||||
<option value="rtf">RTF</option>
|
||||
<option value="txt:Text">TXT</option>
|
||||
</select>
|
||||
</div>
|
||||
<br>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToText.submit}"></button>
|
||||
|
||||
</form>
|
||||
<p class="mt-3" th:text="#{PDFToText.credit}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
||||
</div>
|
||||
40
src/main/resources/templates/convert/pdf-to-word.html
Normal file
40
src/main/resources/templates/convert/pdf-to-word.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:insert="~{fragments/common :: head(title=#{PDFToWord.title})}"></th:block>
|
||||
<body>
|
||||
<div id="page-container">
|
||||
<div id="content-wrap">
|
||||
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
||||
<br> <br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2 th:text="#{PDFToWord.header}"></h2>
|
||||
<form method="post" enctype="multipart/form-data" th:action="@{pdf-to-word}">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label th:text="#{PDFToWord.selectText.1}"></label>
|
||||
<select class="form-control" name="outputFormat">
|
||||
<option value="doc">Doc</option>
|
||||
<option value="docx">DocX</option>
|
||||
<option value="odt">Odt</option>
|
||||
</select>
|
||||
</div>
|
||||
<br>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToWord.submit}"></button>
|
||||
|
||||
</form>
|
||||
<p class="mt-3" th:text="#{PDFToWord.credit}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
28
src/main/resources/templates/convert/pdf-to-xml.html
Normal file
28
src/main/resources/templates/convert/pdf-to-xml.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:insert="~{fragments/common :: head(title=#{PDFToXML.title})}"></th:block>
|
||||
<body>
|
||||
<div id="page-container">
|
||||
<div id="content-wrap">
|
||||
<div th:insert="~{fragments/navbar.html :: navbar}"></div>
|
||||
<br> <br>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<h2 th:text="#{PDFToXML.header}"></h2>
|
||||
<form method="post" enctype="multipart/form-data" th:action="@{pdf-to-xml}">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
||||
<br>
|
||||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{PDFToXML.submit}"></button>
|
||||
|
||||
</form>
|
||||
<p class="mt-3" th:text="#{PDFToXML.credit}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:insert="~{fragments/footer.html :: footer}"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,5 +1,6 @@
|
||||
<div th:fragment="card" class="feature-card">
|
||||
<h5 class="card-title" th:text="${cardTitle}"></h5>
|
||||
<p class="card-text" th:text="${cardText}"></p>
|
||||
<a class="btn btn-primary" th:href="${cardLink}" th:text="#{goToPage}"></a>
|
||||
<a th:href="${cardLink}">
|
||||
<h5 class="card-title text-primary" th:text="${cardTitle}"></h5>
|
||||
<p class="card-text" th:text="${cardText}"></p>
|
||||
</a>
|
||||
</div>
|
||||
@@ -96,16 +96,23 @@ function compareVersions(version1, version2) {
|
||||
|
||||
<li class="nav-item"><a class="nav-link" href="#" th:href="@{rotate-pdf}" th:classappend="${currentPage}=='rotate-pdf' ? 'active' : ''" th:text="#{home.rotate.title}"></a></li>
|
||||
|
||||
<li class="nav-item dropdown" th:classappend="${currentPage}=='pdf-to-img' OR ${currentPage}=='img-to-pdf' OR ${currentPage}=='pdf-to-pdfa' OR ${currentPage}=='file-to-pdf' OR ${currentPage}=='xlsx-to-pdf' ? 'active' : ''"><a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
|
||||
<li class="nav-item dropdown" th:classappend="${currentPage}=='pdf-to-img' OR ${currentPage}=='img-to-pdf' OR ${currentPage}=='pdf-to-pdfa' OR ${currentPage}=='file-to-pdf' OR ${currentPage}=='xlsx-to-pdf' OR ${currentPage}=='pdf-to-word' OR ${currentPage}=='pdf-to-presentation' OR ${currentPage}=='pdf-to-text' OR ${currentPage}=='pdf-to-html' OR ${currentPage}=='pdf-to-xml' ? 'active' : ''"><a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="false" th:text="#{navbar.convert}"></a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-img}" th:classappend="${currentPage}=='pdf-to-img' ? 'active' : ''" th:text="#{home.pdfToImage.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{img-to-pdf}" th:classappend="${currentPage}=='img-to-pdf' ? 'active' : ''" th:text="#{home.imageToPdf.title}"></a>
|
||||
<!-- Existing menu items -->
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-img}" th:classappend="${currentPage}=='pdf-to-img' ? 'active' : ''" th:text="#{home.pdfToImage.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{img-to-pdf}" th:classappend="${currentPage}=='img-to-pdf' ? 'active' : ''" th:text="#{home.imageToPdf.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{file-to-pdf}" th:classappend="${currentPage}=='file-to-pdf' ? 'active' : ''" th:text="#{home.fileToPDF.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-pdfa}" th:classappend="${currentPage}=='pdf-to-pdfa' ? 'active' : ''" th:text="#{home.pdfToPDFA.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-word}" th:classappend="${currentPage}=='pdf-to-word' ? 'active' : ''" th:text="#{home.PDFToWord.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-presentation}" th:classappend="${currentPage}=='pdf-to-presentation' ? 'active' : ''" th:text="#{home.PDFToPresentation.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-text}" th:classappend="${currentPage}=='pdf-to-text' ? 'active' : ''" th:text="#{home.PDFToText.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-html}" th:classappend="${currentPage}=='pdf-to-html' ? 'active' : ''" th:text="#{home.PDFToHTML.title}"></a>
|
||||
<a class="dropdown-item" href="#" th:href="@{pdf-to-xml}" th:classappend="${currentPage}=='pdf-to-xml' ? 'active' : ''" th:text="#{home.PDFToXML.title}"></a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="nav-item dropdown" th:classappend="${currentPage}=='add-password' OR ${currentPage}=='remove-password' OR ${currentPage}=='change-permissions' OR ${currentPage}=='add-watermark' OR ${currentPage}=='remove-watermark' ? 'active' : ''">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" th:text="#{navbar.security}"></a>
|
||||
@@ -146,6 +153,7 @@ function compareVersions(version1, version2) {
|
||||
<a class="dropdown-item lang_dropdown-item" href="" data-language-code="ar_AR" >العربية</a>
|
||||
<a class="dropdown-item lang_dropdown-item" href="" data-language-code="de_DE" >Deutsch</a>
|
||||
<a class="dropdown-item lang_dropdown-item" href="" data-language-code="fr_FR" >Français</a>
|
||||
<a class="dropdown-item lang_dropdown-item" href="" data-language-code="es_ES" >Spanish</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -6,22 +6,46 @@
|
||||
|
||||
<style>
|
||||
.features-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(21rem, 3fr));
|
||||
gap: 25px 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(21rem, 3fr));
|
||||
gap: 25px 30px;
|
||||
}
|
||||
|
||||
.feature-card {
|
||||
border: 1px solid rgba(0, 0, 0, .125);
|
||||
border-radius: 0.25rem;
|
||||
padding: 1.25rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
border: 2px solid rgba(0, 0, 0, .25);
|
||||
border-radius: 0.25rem;
|
||||
padding: 1.25rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
background: rgba(13, 110, 253, 0.05);
|
||||
transition: transform 0.3s, border 0.3s;
|
||||
}
|
||||
|
||||
.feature-card a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.feature-card .card-text {
|
||||
flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.feature-card:hover {
|
||||
border: 2px solid rgba(0, 0, 0, .5);
|
||||
cursor: pointer;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.feature-card:hover .card-title {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.card-title.text-primary {
|
||||
color: #013275; /* Replace with your desired shade of blue */
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -66,6 +90,15 @@
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.extractImages.title}, cardText=#{home.extractImages.desc}, cardLink='extract-images')}"></div>
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.pdfToPDFA.title}, cardText=#{home.pdfToPDFA.desc}, cardLink='pdf-to-pdfa')}"></div>
|
||||
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.PDFToWord.title}, cardText=#{home.PDFToWord.desc}, cardLink='pdf-to-word')}"></div>
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.PDFToPresentation.title}, cardText=#{home.PDFToPresentation.desc}, cardLink='pdf-to-presentation')}"></div>
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.PDFToText.title}, cardText=#{home.PDFToText.desc}, cardLink='pdf-to-text')}"></div>
|
||||
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.PDFToHTML.title}, cardText=#{home.PDFToHTML.desc}, cardLink='pdf-to-html')}"></div>
|
||||
<div th:replace="~{fragments/card :: card(cardTitle=#{home.PDFToXML.title}, cardText=#{home.PDFToXML.desc}, cardLink='pdf-to-xml')}"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user