Stirling-PDF/README.md

219 lines
11 KiB
Markdown
Raw Normal View History

<p align="center"><img src="https://raw.githubusercontent.com/Frooodle/Stirling-PDF/main/docs/stirling.png" width="80" ><br><h1 align="center">Stirling-PDF</h1>
</p>
2023-02-04 16:06:27 +01:00
[![Docker Pulls](https://img.shields.io/docker/pulls/frooodle/s-pdf)](https://hub.docker.com/r/frooodle/s-pdf)
2023-02-12 19:24:13 +01:00
[![Discord](https://img.shields.io/discord/1068636748814483718?label=Discord)](https://discord.gg/Cn8pWhQRxZ)
[![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/frooodle/s-pdf/latest)](https://github.com/Frooodle/Stirling-PDF/)
[![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)
2023-04-19 16:35:58 +02:00
[![Github Sponser](https://img.shields.io/badge/Github%20Sponsor-yellow?style=flat&logo=github)](https://github.com/sponsors/Frooodle)
2023-01-27 19:23:40 +01:00
2023-07-29 15:31:09 +02:00
[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/Frooodle/Stirling-PDF/tree/digitalOcean&refcode=c3210994b1af)
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.
2023-01-30 22:46:38 +01:00
Stirling PDF makes no outbound calls for any record keeping or tracking.
2023-05-17 19:16:39 +02:00
All files and PDFs are either purely client side, in server memory only during the execution of the task or within a temporay file only for execution of the task.
Any file which has been downloaded by the user will have already been deleted from the server by that time.
2023-04-26 23:17:47 +02:00
Feel free to request any features or bug fixes either in github issues or our [Discord](https://discord.gg/Cn8pWhQRxZ)
2023-01-27 19:23:40 +01:00
2023-01-30 21:50:47 +01:00
![stirling-home](images/stirling-home.png)
2023-01-27 19:23:40 +01:00
## Features
2023-06-06 00:08:55 +02:00
- Full interactive GUI for merging/splitting/rotating/moving PDFs and their pages.
2023-01-27 19:23:40 +01:00
- Split PDFs into multiple files at specified page numbers or extract all pages as individual files.
- Merge multiple PDFs together into a single resultant file
- Convert PDFs to and from images
- Reorganize PDF pages into different orders.
2023-05-06 17:10:06 +02:00
- Add/Generate signatures
2023-07-25 22:21:43 +02:00
- Format PDFs into a multi-paged page
- Scale page contents size by set %
- Adjust Contrast
- Crop PDF
- Auto Split PDF (With physically scanned page dividers)
2023-05-06 17:10:06 +02:00
- Flatten PDFs
- Repair PDFs
2023-05-08 23:55:01 +02:00
- Detect and remove blank pages
- Compare 2 PDFs and show differences in text
2023-05-06 17:10:06 +02:00
- Add images to PDFs
2023-01-30 22:39:17 +01:00
- Rotating PDFs in 90 degree increments.
2023-03-20 23:24:07 +01:00
- Compressing PDFs to decrease their filesize. (Using OCRMyPDF)
- Add and remove passwords
- Set PDF Permissions
- Add watermark(s)
2023-03-20 23:24:07 +01:00
- Convert Any common file to PDF (using LibreOffice)
- Convert PDF to Word/Powerpoint/Others (using LibreOffice)
2023-07-25 22:21:43 +02:00
- Convert HTML to PDF
- URL to PDF
2023-03-20 23:24:07 +01:00
- Extract images from PDF
2023-07-25 22:21:43 +02:00
- Extract images from Scans
- Add page numbers
- Auto rename file by detecting PDF header text
2023-03-20 23:24:07 +01:00
- OCR on PDF (Using OCRMyPDF)
2023-07-25 22:21:43 +02:00
- PDF/A conversion (Using OCRMyPDF)
- Edit metadata
2023-01-27 19:23:40 +01:00
- Dark mode support.
2023-03-28 15:59:40 +02:00
- Custom download options (see [here](https://github.com/Frooodle/Stirling-PDF/blob/main/images/settings.png) for example)
2023-03-20 23:33:24 +01:00
- Parallel file processing and downloads
2023-05-06 17:10:06 +02:00
- API for integration with external scripts
2023-01-27 19:23:40 +01:00
2023-05-17 19:16:39 +02:00
For a overview of the tasks and the technology each uses please view [groups.md](https://github.com/Frooodle/Stirling-PDF/blob/main/Groups.md)
2023-05-06 18:21:02 +02:00
Hosted instance/demo of the app can be seen [here](https://pdf.adminforge.de/) hosted by the team at adminforge.de
2023-01-27 19:23:40 +01:00
## Technologies used
- Spring Boot + Thymeleaf
- PDFBox
- IText7
2023-03-28 15:59:40 +02:00
- [LibreOffice](https://www.libreoffice.org/discover/libreoffice/) for advanced conversions
- [OcrMyPdf](https://github.com/ocrmypdf/OCRmyPDF)
2023-01-27 19:23:40 +01:00
- HTML, CSS, JavaScript
- Docker
2023-04-19 16:38:18 +02:00
- PDF.js
- PDF-LIB.js
2023-01-27 19:23:40 +01:00
## How to use
### Locally
2023-05-11 15:36:20 +02:00
Please view https://github.com/Frooodle/Stirling-PDF/blob/main/LocalRunGuide.md
2023-01-27 19:23:40 +01:00
### Docker
2023-01-27 20:10:24 +01:00
https://hub.docker.com/r/frooodle/s-pdf
Stirling PDF has 3 different versions, a Full version, Lite and ultra-Lite. Depending on the types of features you use you may want a smaller image to save on space.
To see what the different versions offer please look at our [version mapping](https://github.com/Frooodle/Stirling-PDF/blob/main/Version-groups.md)
For people that dont mind about space optimisation just use latest tag.
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/frooodle/s-pdf/latest?label=Stirling-PDF%20Full)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/frooodle/s-pdf/latest-lite?label=Stirling-PDF%20Lite)
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/frooodle/s-pdf/latest-ultra-lite?label=Stirling-PDF%20Ultra-Lite)
Docker Run
```
2023-05-06 17:10:06 +02:00
docker run -d \
-p 8080:8080 \
-v /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata \
--name stirling-pdf \
frooodle/s-pdf:latest
2023-05-06 17:10:06 +02:00
2023-05-08 23:55:01 +02:00
Can also add these for customisation but are not required
2023-07-04 22:45:35 +02:00
-v /location/of/extraConfigs:/configs \
-v /location/of/customFiles:/customFiles \
2023-05-06 17:10:06 +02:00
-e APP_HOME_NAME="Stirling PDF" \
-e APP_HOME_DESCRIPTION="Your locally hosted one-stop-shop for all your PDF needs." \
-e APP_NAVBAR_NAME="Stirling PDF" \
2023-05-17 17:16:11 +02:00
-e ALLOW_GOOGLE_VISIBILITY="true" \
2023-05-11 00:26:31 +02:00
-e APP_ROOT_PATH="/" \
2023-05-08 23:55:01 +02:00
-e APP_LOCALE="en_GB" \
```
Docker Compose
```
version: '3.3'
services:
2023-05-06 17:10:06 +02:00
stirling-pdf:
image: frooodle/s-pdf:latest
2023-05-06 17:10:06 +02:00
ports:
- '8080:8080'
volumes:
- /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata #Required for extra OCR languages
# - /location/of/extraConfigs:/configs
2023-07-04 22:45:35 +02:00
# - /location/of/customFiles:/customFiles/
2023-05-06 17:10:06 +02:00
# environment:
2023-05-08 23:55:01 +02:00
# APP_LOCALE: en_GB
2023-05-06 17:10:06 +02:00
# APP_HOME_NAME: Stirling PDF
# APP_HOME_DESCRIPTION: Your locally hosted one-stop-shop for all your PDF needs.
# APP_NAVBAR_NAME: Stirling PDF
2023-05-11 00:26:31 +02:00
# APP_ROOT_PATH: /
2023-05-17 17:16:11 +02:00
# ALLOW_GOOGLE_VISIBILITY: true
2023-05-06 17:10:06 +02:00
```
2023-01-27 19:23:40 +01:00
2023-04-02 12:51:07 +02:00
2023-03-28 15:59:40 +02:00
## Enable OCR/Compression feature
Please view https://github.com/Frooodle/Stirling-PDF/blob/main/HowToUseOCR.md
## Want to add your own language?
2023-06-29 23:03:31 +02:00
Stirling PDF currently supports 16!
- English (English) (en_GB)
- Arabic (العربية) (ar_AR)
- German (Deutsch) (de_DE)
- French (Français) (fr_FR)
- Spanish (Español) (es_ES)
2023-05-20 00:34:50 +02:00
- Chinese (简体中文) (zh_CN)
- Catalan (Català) (ca_CA)
- Italian (Italiano) (it_IT)
- Swedish (Svenska) (sv_SE)
2023-05-17 19:16:39 +02:00
- Polish (Polski) (pl_PL)
2023-05-22 21:43:24 +02:00
- Romanian (Română) (ro_RO)
- Korean (한국어) (ko_KR)
2023-06-29 18:07:34 +02:00
- Portuguese Brazilian (Português) (pt_BR)
- Russian (Русский) (ru_RU)
2023-06-29 23:02:59 +02:00
- Basque (Euskara) (eu_ES)
- Japanese (日本語) (ja_JP)
2023-05-11 15:31:08 +02:00
2023-03-28 15:59:40 +02:00
If you want to add your own language to Stirling-PDF please refer
https://github.com/Frooodle/Stirling-PDF/blob/main/HowToAddNewLanguage.md
And please create a PR to merge it back in so others can use it!
Also please note as i add new features i will google translate existing languages so that they dont lose support. This could mean that new features need grammer corrections as added.
2023-01-27 19:23:40 +01:00
## How to View
1. Open a web browser and navigate to `http://localhost:8080/`
2. Use the application by following the instructions on the website.
2023-03-28 15:59:40 +02:00
2023-04-03 00:59:22 +02:00
## Customize App
2023-04-02 12:51:07 +02:00
Stirling PDF allows easy customization of the visible application name.
Simply use environment variables APP_HOME_NAME, APP_HOME_DESCRIPTION and APP_NAVBAR_NAME with Docker or Java.
2023-04-03 00:59:22 +02:00
If running Java directly, you can also pass these as properties using -D arguments.
2023-05-08 23:55:01 +02:00
Using the same method you can also change
2023-05-18 01:05:53 +02:00
2023-05-17 19:16:39 +02:00
- The default language by providing APP_LOCALE with values like de-DE fr-FR or ar-AR (Note the - character not _ ) to select your default language (Will always default to English on invalid locale) Current accepted locales can be seen above in the Want to add your own language section
2023-05-18 01:05:53 +02:00
- Enable/Disable search engine visiblility with ALLOW_GOOGLE_VISIBILITY with true / false values. Default disable visiblility.
2023-05-11 00:26:31 +02:00
- Change root URI for Stirling-PDF ie change server.com/ to server.com/pdf-app by running APP_ROOT_PATH as pdf-app
2023-05-19 01:32:37 +02:00
- Disable and remove endpoints and functionality from Stirling-PDF. Currently the endpoints ENDPOINTS_TO_REMOVE and GROUPS_TO_REMOVE can include comma seperated lists of endpoints and groups to disable as example ENDPOINTS_TO_REMOVE=img-to-pdf,remove-pages would disable both image to pdf and remove pages, GROUPS_TO_REMOVE=LibreOffice Would disable all things that use LibreOffice. You can see a list of all endpoints and groups [here](https://github.com/Frooodle/Stirling-PDF/blob/main/groups.md)
2023-07-02 20:19:49 +02:00
- Change the max file size allowed through the server with the environment variable MAX_FILE_SIZE. default 2000MB
2023-07-04 22:45:35 +02:00
- Customise static files such as app logo by placing files in the /customFiles/static/ directory. Example to customise app logo is placing a /customFiles/static/favicon.svg to override current SVG. This can be used to change any images/icons/css/fonts/js etc in Stirling-PDF
2023-08-08 20:55:18 +02:00
- Enable/Disable metric api endpoints with ENABLE_API_METRICS. Default enabled
2023-05-17 19:17:11 +02:00
2023-04-29 00:54:53 +02:00
## API
For those wanting to use Stirling-PDFs backend API to link with their own custom scripting to edit PDFs you can view all existing API documentation
2023-07-04 22:45:35 +02:00
[here](https://app.swaggerhub.com/apis-docs/Frooodle/Stirling-PDF/) or navigate to /swagger-ui/index.html of your stirling-pdf instance for your versions documentation (Or by following the API button in your settings of Stirling-PDF)
2023-05-19 00:17:46 +02:00
2023-08-17 23:17:42 +02:00
## Login authentication (CURRENTLY ALPHA TAG ONLY)
2023-08-17 23:19:11 +02:00
### Prerequisites:
2023-08-17 23:17:42 +02:00
- User must have the folder ./configs volumed within docker so that it is retained during updates.
- The environment variable 'login.enabled' must be set to true
- The environment variables "INITIAL_USERNAME" and "INITIAL_PASSWORD" must also be populated (only required on first boot to create initial user, ignored after.)
2023-08-17 23:20:50 +02:00
Once the above has been done, on restart a new stirling-pdf-DB.mv.db will show if everything worked.
2023-08-17 23:19:11 +02:00
2023-08-17 23:20:50 +02:00
When you login to Stirling PDF you will be redirected to /login page to login with those credentials. After login everything should function as normal
2023-08-17 23:19:11 +02:00
2023-08-17 23:20:50 +02:00
To access your account settings go to Account settings in the settings cog menu (top right in navbar) this Account settings menu is also where you find your API key.
2023-08-17 23:19:11 +02:00
To add new users go to bottom of Account settings and hit 'Admin Settings', here you can add new users. The different roles mentioned within this are for rate limiting. This is a Work in progress which will be expanding on more in future
2023-08-17 23:17:42 +02:00
For API usage you must provide a header with 'X-API-Key' and the associated API key for that user.
2023-05-19 00:17:46 +02:00
2023-08-17 23:17:42 +02:00
## FAQ
### Q1: What are your planned features?
2023-05-19 00:17:46 +02:00
- Progress bar/Tracking
- Full custom logic pipelines to combine multiple operations together.
- Folder support with auto scanning to perform operations on
2023-08-26 23:35:10 +02:00
- Redact text (Via UI)
2023-08-25 00:23:25 +02:00
- Add Forms
- Annotations
- Multi page layout (Stich PDF pages together) support x rows y columns and custom page sizing
- Fill forms mannual and automatic
2023-05-19 00:17:46 +02:00
2023-08-17 23:17:42 +02:00
### Q2: Why is my application downloading .htm files?
2023-05-19 01:32:37 +02:00
This is a issue caused commonly by your NGINX congifuration. The default file upload size for NGINX is 1MB, you need to add the following in your Nginx sites-available file. client_max_body_size SIZE; Where "SIZE" is 50M for example for 50MB files.