Stirling-Tools / Stirling-PDF
- воскресенье, 5 мая 2024 г. в 00:00:03
#1 Locally hosted web application that allows you to perform various operations on PDF files
This is a robust, locally hosted web-based PDF manipulation tool using Docker. It enables you to carry out various operations on PDF files, including splitting, merging, converting, reorganizing, adding images, rotating, compressing, and more. This locally hosted web application has evolved to encompass a comprehensive set of features, addressing all your PDF requirements.
Stirling PDF does not initiate any outbound calls for record-keeping or tracking purposes.
All files and PDFs exist either exclusively on the client side, reside in server memory only during task execution, or temporarily reside in a file solely for the execution of the task. Any file downloaded by the user will have been deleted from the server by that point.
For a overview of the tasks and the technology each uses please view Endpoint-groups.md Demo of the app is available here. username: demo, password: demo
Please view https://github.com/Stirling-Tools/Stirling-PDF/blob/main/LocalRunGuide.md
https://hub.docker.com/r/frooodle/s-pdf
Stirling PDF has 2 different versions, a Full version and ultra-Lite version. 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
For people that don't mind about space optimization just use the latest tag.
Docker Run
docker run -d \
-p 8080:8080 \
-v /location/of/trainingData:/usr/share/tessdata \
-v /location/of/extraConfigs:/configs \
-v /location/of/logs:/logs \
-e DOCKER_ENABLE_SECURITY=false \
-e INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false \
-e LANGS=en_GB \
--name stirling-pdf \
frooodle/s-pdf:latest
Can also add these for customisation but are not required
-v /location/of/customFiles:/customFiles \
Docker Compose
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8080:8080'
volumes:
- /location/of/trainingData:/usr/share/tessdata #Required for extra OCR languages
- /location/of/extraConfigs:/configs
# - /location/of/customFiles:/customFiles/
# - /location/of/logs:/logs/
environment:
- DOCKER_ENABLE_SECURITY=false
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=en_GB
Note: Podman is CLI-compatible with Docker, so simply replace "docker" with "podman".
Please view https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToUseOCR.md
Stirling PDF currently supports 27!
Please see our Contributing Guide!
Stirling PDF allows easy customization of the app. Includes things like
There are two options for this, either using the generated settings file settings.yml
This file is located in the /configs
directory and follows standard YAML formatting
Environment variables are also supported and would override the settings file For example in the settings.yml you have
system:
defaultLocale: 'en-US'
To have this via an environment variable you would have SYSTEM_DEFAULTLOCALE
The Current list of settings is
security:
enableLogin: false # set to 'true' to enable login
csrfDisabled: true
system:
defaultLocale: 'en-US' # Set the default language (e.g. 'de-DE', 'fr-FR', etc)
googlevisibility: false # 'true' to allow Google visibility (via robots.txt), 'false' to disallow
customStaticFilePath: '/customFiles/static/' # Directory path for custom static files
showUpdate: true # see when a new update is available
showUpdateOnlyAdmin: false # Only admins can see when a new update is available, depending on showUpdate it must be set to 'true'
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template html files
#ui:
# appName: exampleAppName # Application's visible name
# homeDescription: I am a description # Short description or tagline shown on homepage.
# appNameNavbar: navbarName # Name displayed on the navigation bar
endpoints:
toRemove: [] # List endpoints to disable (e.g. ['img-to-pdf', 'remove-pages'])
groupsToRemove: [] # List groups to disable (e.g. ['LibreOffice'])
metrics:
enabled: true # 'true' to enable Info APIs endpoints (view http://localhost:8080/swagger-ui/index.html#/API to learn more), 'false' to disable
There is an additional config file /configs/custom_settings.yml
were users familiar with java and spring application.properties can input their own settings on-top of Stirling-PDFs existing ones
SYSTEM_ROOTURIPATH
ie set to /pdf-app
to Set the application's root URI to localhost:8080/pdf-app
SYSTEM_CONNECTIONTIMEOUTMINUTES
to set custom connection timeout valuesDOCKER_ENABLE_SECURITY
to tell docker to download security jar (required as true for auth login)INSTALL_BOOK_AND_ADVANCED_HTML_OPS
to download calibre onto stirling-pdf enabling pdf to/from book and advanced html conversionLANGS
to define custom font libraries to install for use for document conversionsFor 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 here 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)
DOCKER_ENABLE_SECURITY
to true
in environment variables.SECURITY_ENABLE_LOGIN
to true
admin
and password stirling
. On login you will be forced to change the password to a new one. You can also use the environment variables SECURITY_INITIALLOGIN_USERNAME
and SECURITY_INITIALLOGIN_PASSWORD
to set your own straight away (Recommended to remove them after user creation).Once the above has been done, on restart, a new stirling-pdf-DB.mv.db will show if everything worked.
When you login to Stirling PDF you will be redirected to /login page to login with those default credentials. After login everything should function as normal
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.
To add new users go to the 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
For API usage you must provide a header with 'X-API-Key' and the associated API key for that user.
This is an issue caused commonly by your NGINX configuration. 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.
NGINX has timeout values by default so if you are running Stirling-PDF behind NGINX you may need to set a timeout value such as adding the config proxy_read_timeout 3600;