Compare commits

...

20 Commits

Author SHA1 Message Date
Anthony Stirling
d532db91f9 fixes for #438 and #423 2023-10-28 10:40:26 +01:00
Anthony Stirling
bd0bf404f5 Merge pull request #445 from DimK10/Feature-request-pdf-reader
Adds navbar logo to pdf viewer
2023-10-27 18:28:33 +01:00
Dimitris Kaitantzidis
e51a9c209a Merge branch 'main' into Feature-request-pdf-reader 2023-10-27 20:11:14 +03:00
Dimitrios Kaitantzidis
6bf172fb25 Adds navbar logo to pdf viewer 2023-10-27 20:08:13 +03:00
Anthony Stirling
a1e93e0f5d Update .gitattributes 2023-10-25 22:07:05 +01:00
Anthony Stirling
6392f6ec12 Merge pull request #442 from joleaf/main
Fix help text in addPageNumbers.customNumberDesc
2023-10-25 10:20:33 +01:00
joleaf
fbdff5c97f Update messages_it_IT.properties - fix helptext addPageNumbers.customNumberDesc 2023-10-25 10:55:13 +02:00
joleaf
2ecc4ed080 Update messages_es_ES.properties - Fix helptext addPageNumbers.customNumberDesc 2023-10-25 10:54:21 +02:00
joleaf
3318cb96b2 Update messages_de_DE.properties - fix helptext addPageNumbers.customNumberDesc 2023-10-25 10:53:10 +02:00
Anthony Stirling
ab1297aee0 Version bump and readme change 2023-10-22 23:14:18 +01:00
Anthony Stirling
25a0cb7681 Merge pull request #439 from DimK10/Feature-request-pdf-reader
Feature request pdf reader
2023-10-22 23:02:14 +01:00
Dimitrios Kaitantzidis
116b034878 Adds support for greek language. 2023-10-23 00:56:53 +03:00
Dimitrios Kaitantzidis
038de2e264 Adds ignore for .idea folder entirely 2023-10-23 00:43:43 +03:00
Dimitrios Kaitantzidis
7e51cf8c5a Removes .idea files and updates README.md. 2023-10-23 00:40:03 +03:00
Dimitrios Kaitantzidis
a1eadba769 Fixes .idea ignored files. 2023-10-23 00:27:36 +03:00
Dimitrios Kaitantzidis
3145f5fdd0 Feature ready. 2023-10-23 00:12:13 +03:00
Dimitrios Kaitantzidis
8393dd4731 Deletes unnecessary files 2023-10-22 20:54:23 +03:00
Dimitrios Kaitantzidis
768877d969 Reader works correctly 2023-10-22 20:32:19 +03:00
Dimitrios Kaitantzidis
14a90f5e50 WIP: No errors but nothing is working 2023-10-22 20:16:59 +03:00
Dimitrios Kaitantzidis
99b0150e7a WIP: Adds Drap and drop 2023-10-21 11:26:58 +03:00
384 changed files with 66455 additions and 24028 deletions

1
.gitattributes vendored
View File

@@ -1,5 +1,6 @@
# Ignore all JavaScript files in a directory
src/main/resources/static/pdfjs/* linguist-vendored
src/main/resources/static/pdfjs/** linguist-vendored
src/main/resources/static/css/bootstrap-icons.css linguist-vendored
src/main/resources/static/css/bootstrap.min.css linguist-vendored
src/main/resources/static/css/fonts/* linguist-vendored

1
.gitignore vendored
View File

@@ -120,3 +120,4 @@ watchedFolders/
/build
/.vscode
/.idea

8
.idea/.gitignore generated vendored
View File

@@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -32,6 +32,7 @@ Feel free to request any features or bug fixes either in github issues or our [D
## **PDF Features**
### **Page Operations**
- View and modify PDFs - View multi page PDFs with custom viewing sorting and searching. Plus on page edit features like annotate, draw and adding text and images. (Using PDF.js with Joxit and Liberation.Liberation fonts)
- Full interactive GUI for merging/splitting/rotating/moving PDFs and their pages.
- Merge multiple PDFs together into a single resultant file.
- Split PDFs into multiple files at specified page numbers or extract all pages as individual files.
@@ -144,7 +145,7 @@ services:
Please view https://github.com/Frooodle/Stirling-PDF/blob/main/HowToUseOCR.md
## Want to add your own language?
Stirling PDF currently supports 18!
Stirling PDF currently supports 19!
- English (English) (en_GB)
- English (US) (en_US)
- Arabic (العربية) (ar_AR)
@@ -163,6 +164,7 @@ Stirling PDF currently supports 18!
- Basque (Euskara) (eu_ES)
- Japanese (日本語) (ja_JP)
- Dutch (Nederlands) (nl_NL)
- Greek (el_GR)
If you want to add your own language to Stirling-PDF please refer
https://github.com/Frooodle/Stirling-PDF/blob/main/HowToAddNewLanguage.md
@@ -257,7 +259,6 @@ For API usage you must provide a header with 'X-API-Key' and the associated API
- Folder support with auto scanning to perform operations on
- Redact text (Via UI not just automated way)
- Add Forms
- Annotations
- Multi page layout (Stich PDF pages together) support x rows y columns and custom page sizing
- Fill forms mannual and automatic

View File

@@ -8,7 +8,7 @@ plugins {
}
group = 'stirling.software'
version = '0.14.5'
version = '0.15.0'
sourceCompatibility = '17'
repositories {

View File

@@ -27,7 +27,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import stirling.software.SPDF.model.api.PDFWithPageNums;
import stirling.software.SPDF.utils.WebResponseUtils;
import org.apache.pdfbox.multipdf.Splitter;
@RestController
@RequestMapping("/api/v1/general")
@Tag(name = "General", description = "General APIs")
@@ -50,24 +50,26 @@ public class SplitPDFController {
pageNumbers.add(document.getNumberOfPages()- 1);
logger.info("Splitting PDF into pages: {}", pageNumbers.stream().map(String::valueOf).collect(Collectors.joining(",")));
Splitter splitter = new Splitter();
// split the document
List<ByteArrayOutputStream> splitDocumentsBoas = new ArrayList<>();
int previousPageNumber = 1; // PDFBox uses 1-based indexing for pages.
int previousPageNumber = 0;
for (int splitPoint : pageNumbers) {
splitPoint = splitPoint + 1;
splitter.setStartPage(previousPageNumber);
splitter.setEndPage(splitPoint);
List<PDDocument> splitDocuments = splitter.split(document);
for (PDDocument splitDoc : splitDocuments) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
splitDoc.save(baos);
splitDocumentsBoas.add(baos);
splitDoc.close();
try (PDDocument splitDocument = new PDDocument()) {
for (int i = previousPageNumber; i <= splitPoint; i++) {
PDPage page = document.getPage(i);
splitDocument.addPage(page);
logger.debug("Adding page {} to split document", i);
}
previousPageNumber = splitPoint + 1;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
splitDocument.save(baos);
splitDocumentsBoas.add(baos);
} catch (Exception e) {
logger.error("Failed splitting documents and saving them", e);
throw e;
}
}

View File

@@ -1,18 +1,9 @@
package stirling.software.SPDF.controller.web;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
@@ -21,11 +12,14 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Controller
@Tag(name = "General", description = "General APIs")
@@ -81,6 +75,12 @@ public class GeneralWebController {
return "merge-pdfs";
}
@GetMapping("/view-pdf")
@Hidden
public String ViewPdfForm2(Model model) {
model.addAttribute("currentPage", "view-pdf");
return "view-pdf";
}
@GetMapping("/multi-tool")
@Hidden

View File

@@ -430,7 +430,7 @@ addPageNumbers.selectText.5=Seiten zu nummerieren
addPageNumbers.selectText.6=Benutzerdefinierter Text
addPageNumbers.customTextDesc=Benutzerdefinierter Text
addPageNumbers.numberPagesDesc=Welche Seiten nummeriert werden sollen, Standardeinstellung 'alle' ('all'), akzeptiert auch 1-5 oder 2,5,9 usw.
addPageNumbers.customNumberDesc=Standardmäßig {n}, akzeptiert auch 'Seite {n} von {insgesamt}', 'Text-{n}', '{Dateiname}-{n} ('{filename}-{n})
addPageNumbers.customNumberDesc=Standardmäßig {n}, akzeptiert auch 'Seite {n} von {total}', 'Text-{n}', '{filename}-{n}'
addPageNumbers.submit=Seitenzahlen hinzufügen

View File

@@ -127,6 +127,9 @@ adminUserSettings.submit=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\
#############
home.desc= \u0397 \u03C4\u03BF\u03C0\u03B9\u03BA\u03AC \u03C6\u03B9\u03BB\u03BF\u03BE\u03B5\u03BD\u03BF\u03CD\u03BC\u03B5\u03BD\u03B7 one-stop-shop \u03C3\u03B1\u03C2 \u03B3\u03B9\u03B1 \u03CC\u03BB\u03B5\u03C2 \u03C4\u03B9\u03C2 \u03B1\u03BD\u03AC\u03B3\u03BA\u03B5\u03C2 \u03C3\u03B1\u03C2 \u03C3\u03B5 PDF.
home.viewPdf.title=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7 PDF
home.viewPdf.desc=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7, \u03C0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C3\u03C7\u03B5\u03B4\u03AF\u03BF\u03C5, \u03C0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5 \u03AE \u03B5\u03B9\u03BA\u03CC\u03BD\u03C9\u03BD
viewPdf.tags=view,read,annotate,text,image
home.multiTool.title=PDF \u03A0\u03BF\u03BB\u03C5\u03B5\u03C1\u03B3\u03B1\u03BB\u03B5\u03AF\u03BF
home.multiTool.desc=\u03A3\u03C5\u03B3\u03C7\u03CE\u03BD\u03B5\u03C5\u03C3\u03B7, \u03A0\u03B5\u03C1\u03B9\u03C3\u03C4\u03C1\u03BF\u03C6\u03AE, \u0391\u03BD\u03B1\u03B4\u03B9\u03AC\u03C4\u03B1\u03BE\u03B7 \u03BA\u03B1\u03B9 \u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03C3\u03B5\u03BB\u03AF\u03B4\u03C9\u03BD

View File

@@ -126,6 +126,9 @@ adminUserSettings.submit=Save User
# HOME-PAGE #
#############
home.desc=Your locally hosted one-stop-shop for all your PDF needs.
home.viewPdf.title=View PDF
home.viewPdf.desc=View, annotate, add text or images
viewPdf.tags=view,read,annotate,text,image
home.multiTool.title=PDF Multi Tool
@@ -629,7 +632,9 @@ merge.submit=Merge
pdfOrganiser.title=Page Organizer
pdfOrganiser.header=PDF Page Organizer
pdfOrganiser.submit=Rearrange Pages
#view pdf
viewPdf.title=View PDF
viewPdf.header=View PDF
#multiTool
multiTool.title=PDF Multi Tool

View File

@@ -429,8 +429,8 @@ addPageNumbers.selectText.4=Número de inicio
addPageNumbers.selectText.5=Páginas a numerar
addPageNumbers.selectText.6=Texto personalizado
addPageNumbers.customTextDesc=Texto personalizado
addPageNumbers.numberPagesDesc=Qué páginas numerar, por defecto 'todas', también acepta 1-5 o 2,5,9 etc
addPageNumbers.customNumberDesc=Por defecto a {n}, también acepta 'Página {n} de {total}', 'Texto-{n}', '{nombre de archivo}-{n}
addPageNumbers.numberPagesDesc=Qué páginas numerar, por defecto 'all', también acepta 1-5 o 2,5,9 etc
addPageNumbers.customNumberDesc=Por defecto a {n}, también acepta 'Página {n} de {total}', 'Texto-{n}', '{filename}-{n}
addPageNumbers.submit=Añadir Números de Página

View File

@@ -429,8 +429,8 @@ addPageNumbers.selectText.4=Numero di partenza
addPageNumbers.selectText.5=Pagine da numerare
addPageNumbers.selectText.6=Testo personalizzato
addPageNumbers.customTextDesc=Testo personalizzato
addPageNumbers.numberPagesDesc=Quali pagine numerare, impostazione predefinita "tutte", accetta anche 1-5 o 2,5,9 ecc
addPageNumbers.customNumberDesc=Il valore predefinito è {n}, accetta anche 'Pagina {n} di {totale}', 'Testo-{n}', '{nomefile}-{n}
addPageNumbers.numberPagesDesc=Quali pagine numerare, impostazione predefinita "all", accetta anche 1-5 o 2,5,9 ecc
addPageNumbers.customNumberDesc=Il valore predefinito è {n}, accetta anche 'Pagina {n} di {total}', 'Testo-{n}', '{filename}-{n}
addPageNumbers.submit=Aggiungi numeri di pagina

View File

@@ -0,0 +1,18 @@
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
width="800px" height="800px" viewBox="0 0 318.336 318.336"
xml:space="preserve">
<g>
<g>
<path d="M302.137,74.432h-21.031c-30.496-13.614-56.389-20.611-77.028-20.611c-26.731,0-39.245,11.649-44.906,20.535
c-5.658-8.886-18.17-20.535-44.906-20.535c-20.638,0-46.533,7.003-77.037,20.611H16.2c-8.946,0-16.2,7.253-16.2,16.2v157.684
c0,8.949,7.254,16.2,16.2,16.2h285.937c8.948,0,16.199-7.251,16.199-16.2V90.632C318.336,81.686,311.085,74.432,302.137,74.432z
M154.786,84.265c-0.048,0.25-0.069,0.503-0.069,0.757V233.74c-7.084-8.18-18.95-14.438-38.804-14.438
c-35.44,0-79.927,19.432-95.813,26.947V91.528c13.608-6.927,26.31-12.587,38.156-17.096c21.745-8.271,40.526-12.511,56.004-12.511
c18.992,0,29.37,6.354,34.986,12.511c3.241,3.554,4.91,7.038,5.698,9.192C154.852,83.985,154.791,84.243,154.786,84.265z
M298.234,246.249c-15.884-7.516-60.371-26.947-95.809-26.947c-19.859,0-31.72,6.254-38.805,14.438
c-0.261,0.3-0.562,0.58-0.804,0.886V85.48c0.084-0.351,0.269-0.981,0.583-1.825c0.799-2.149,2.499-5.647,5.776-9.218
c5.648-6.157,16.026-12.512,34.9-12.512c15.478,0,34.251,4.24,56.004,12.512c11.854,4.509,24.548,10.17,38.153,17.097V246.249
L298.234,246.249z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEáCNS2-H

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEá ETen-B5-H` ^

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSE!!<21>º]aX!!]`<60>21<32>> <09>p <0B>z<EFBFBD>$]<06>"Rd<E2809A>-Uƒ7<C692>*
4„%<25>+ „Z „{<7B>/%…<<3C>9K…b<E280A6>1]†.<2E>" ‰`]‡,<2C>"]ˆ

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More