### Install Frontend Dependencies Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Navigates to the frontend directory and installs project dependencies using npm. This is required before running the frontend development server. ```bash cd frontend npm install ``` -------------------------------- ### Install and Verify Unoserver Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Commands to install Unoserver for file conversion and verify the installation version. ```bash pip install unoserver unoserver --version ``` -------------------------------- ### Run Stirling-PDF Backend Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Builds and runs the Spring Boot backend application using Gradle. The backend typically starts on http://localhost:8080. ```bash ./gradlew bootRun ``` -------------------------------- ### Run Frontend Development Server Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Starts the Vite development server for the frontend application. The server typically runs on http://localhost:5173 and automatically proxies API requests to the backend. ```bash npm run dev ``` -------------------------------- ### Install and Verify OpenCV Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Commands to install the OpenCV library via pip and verify the installation by importing the module in Python. ```bash pip install opencv-python python -c "import cv2" ``` -------------------------------- ### Full Development Setup Workflow Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Sets up the full development environment by running the backend and frontend development servers concurrently in separate terminals. Access the application via the provided URLs. ```bash # Terminal 1 - Backend: ./gradlew bootRun # Terminal 2 - Frontend: cd frontend npm run dev ``` -------------------------------- ### Basic Configuration Example (YAML) Source: https://docs.stirlingpdf.com/Configuration/Extra-Settings A simple example demonstrating how to change the server port and adjust logging levels in the custom_settings.yml file. ```yaml # custom_settings.yml server: port: 9000 logging: level: root: INFO org.springframework: WARN org.hibernate: WARN stirling.software.SPDF: INFO ``` -------------------------------- ### Start Unoserver (Bash) Source: https://docs.stirlingpdf.com/Installation/Mac%20Installation Launches the unoserver process on a specified port and interface. This is required for functionalities that rely on LibreOffice for document conversion and can be added to startup scripts. ```bash unoserver --port 2003 --interface 0.0.0.0 ``` -------------------------------- ### Install Calibre in Dockerfile Source: https://docs.stirlingpdf.com/Migration/Breaking-Changes This Dockerfile instruction installs the Calibre package within a Docker image. It updates the package list and then installs 'calibre' using apt-get, ensuring the 'ebook-convert' command is available. ```dockerfile # In your Dockerfile RUN apt-get update && apt-get install -y calibre ``` -------------------------------- ### Running Stirling-PDF Server Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Executes the Stirling-PDF backend service using the Java Runtime Environment. Requires JDK 21 to be installed on the host system. ```bash java -jar Stirling-PDF.jar ``` -------------------------------- ### Install Tesseract OCR on Nix Package Manager Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Installs the Tesseract OCR package using the Nix package manager. Nix typically pre-installs most language packs with the main Tesseract package. ```shell nix-env -iA nixpkgs.tesseract ``` -------------------------------- ### Build Stirling-PDF Desktop Application Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Navigates to the frontend directory and builds the Tauri desktop application. This command creates a distributable version of the native application. ```bash cd frontend npm run tauri-build ``` -------------------------------- ### Troubleshooting Stirling PDF Installation Source: https://docs.stirlingpdf.com/Production-Deployment-Guide This snippet lists common troubleshooting steps for Stirling PDF installation issues. It covers checking firewall rules for port access, viewing container logs for startup problems, and correcting file permissions for the data directory. ```bash # Can't connect? Check firewall rules: sudo ufw allow 8080 # Container won't start? Check logs: docker-compose logs # or docker logs stirling-pdf # Permission errors? # For Docker Compose: sudo chmod -R 755 ./stirling-data # For Docker Run: sudo chmod -R 755 ~/stirling-data ``` -------------------------------- ### Install Tesseract OCR Language Packs on Fedora-based Systems Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Installs Tesseract OCR language packs on Fedora systems. It includes commands to install all language packs, search for specific languages, and list installed language packs. ```shell # All languages # sudo dnf install -y tesseract-langpack-* # Find languages: dnf search -C tesseract-langpack- # View installed languages: rpm -qa | grep tesseract-langpack | sed 's/tesseract-langpack-//g' ``` -------------------------------- ### Run Stirling-PDF Desktop App (Development) Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Navigates to the frontend directory and runs the Tauri desktop application in development mode. This allows for testing the native application locally. ```bash cd frontend npm run tauri-dev ``` -------------------------------- ### HTTPS Configuration Example (YAML) Source: https://docs.stirlingpdf.com/Configuration/Extra-Settings An example showing how to enable HTTPS with a custom certificate by configuring server port, SSL settings, and logging levels in custom_settings.yml. ```yaml # custom_settings.yml server: port: 8443 ssl: enabled: true key-store: classpath:keystore.p12 key-store-password: your-keystore-password key-store-type: PKCS12 key-alias: tomcat logging: level: root: INFO org.springframework: WARN ``` -------------------------------- ### Verify Python Installation Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Command to verify that Python is correctly installed and accessible in the system environment. ```bash python --version ``` -------------------------------- ### Install Nginx and Certbot Source: https://docs.stirlingpdf.com/Production-Deployment-Guide Installs Nginx web server and Certbot for obtaining and renewing Let's Encrypt SSL certificates. This is a prerequisite for using Nginx as a reverse proxy. ```bash sudo apt update sudo apt install nginx certbot python3-certbot-nginx ``` -------------------------------- ### Clone Stirling-PDF Repository Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Clones the Stirling-PDF project from GitHub and navigates into the project directory. This is the first step for setting up the local development environment. ```bash git clone https://github.com/Stirling-Tools/Stirling-PDF.git cd Stirling-PDF ``` -------------------------------- ### Automated Windows MSI Installation Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Uses the msiexec utility to perform a silent, headless installation of the Stirling-PDF desktop application. Parameters allow for pre-configuring server URLs and locking connection settings for enterprise environments. ```batch msiexec /i "Stirling-PDF-windows-x86_64.msi" /qn STIRLING_SERVER_URL="http://192.168.1.53:2357" STIRLING_LOCK_CONNECTION=1 ``` -------------------------------- ### Start and Manage Stirling PDF with Docker Compose Source: https://docs.stirlingpdf.com/Production-Deployment-Guide This snippet provides commands to start, check the status of, and view logs for a Stirling PDF container managed by Docker Compose. It's used after creating the docker-compose.yml file to bring the service online and monitor its activity. ```bash # Start the container docker-compose up -d # Check if it's running docker-compose ps # View logs docker-compose logs -f ``` -------------------------------- ### Install Stirling PDF Dependencies using Nix Package Manager Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Installs Stirling PDF dependencies on systems using the Nix package manager. It uses nix-env to install LibreOffice and Tesseract, and pip3 for Python packages. ```shell nix-env -iA nixpkgs.libreoffice nixpkgs.tesseract nixpkgs.poppler_utils pip3 install uno opencv-python-headless unoserver pngquant WeasyPrint ``` -------------------------------- ### Run All Tests Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Executes all unit and integration tests for the Stirling-PDF project using the Gradle test task. This ensures the codebase is functioning as expected. ```bash ./gradlew test ``` -------------------------------- ### Move Stirling PDF JAR and Scripts to Installation Directory (Debian/Fedora) Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Creates a directory for Stirling PDF, moves the downloaded JAR file and the scripts folder into it, and confirms the installation. This is typically done with root privileges on Debian and Fedora systems. ```shell sudo mkdir /opt/Stirling-PDF &&\ sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\ sudo mv scripts /opt/Stirling-PDF/ &&\ echo "Scripts installed." ``` -------------------------------- ### Install Tesseract Language Packs in Docker Source: https://docs.stirlingpdf.com/Functionality/OCR Instructions for extending OCR language support by installing additional Tesseract language packages within a Docker container environment. ```Dockerfile # Install additional language packs RUN apt-get update && apt-get install -y \ tesseract-ocr-ara \ tesseract-ocr-chi-sim \ tesseract-ocr-jpn ``` -------------------------------- ### Verify System Dependencies via Command Prompt Source: https://docs.stirlingpdf.com/Installation/Windows%20Installation Commands to check if required dependencies like Python, unoserver, OpenCV, and Tesseract are correctly installed and accessible in the system PATH. ```batch python --version unoserver --version python -c "import cv2" tesseract --version ``` -------------------------------- ### Install Stirling PDF Dependencies (Homebrew/Bash/Pip) Source: https://docs.stirlingpdf.com/Installation/Mac%20Installation Installs essential and optional dependencies for Stirling PDF using Homebrew for system packages and pip for Python libraries. Includes Java, PDF tools, document conversion software, and OCR capabilities. ```shell # Install Homebrew if needed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Install dependencies as needed brew install openjdk@21 # Required brew install qpdf # PDF compression brew install --cask libreoffice # Document conversion brew install tesseract # OCR functionality brew install tesseract-lang # Additional OCR languages brew install poppler # PDF to HTML conversion pip3 install weasyprint # URL to PDF conversion pip3 install unoserver # File to PDF conversion ``` -------------------------------- ### Install Stirling PDF Dependencies on Debian-based Systems Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Installs essential software for Stirling PDF on Debian-based systems using apt-get for core applications and pip3 for Python packages. This includes LibreOffice components, Tesseract OCR, and Python libraries like opencv-python-headless. ```shell sudo apt-get install -y libreoffice-writer libreoffice-calc libreoffice-impress tesseract-ocr pip3 install uno opencv-python-headless unoserver pngquant WeasyPrint --break-system-packages ``` -------------------------------- ### Build Stirling-PDF Project Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Builds the entire Stirling-PDF project, including the frontend assets. An option exists to build only the backend by excluding the npm build process. ```bash # Full build including frontend ./gradlew clean build # Backend only ./gradlew build -x npm_run_build ``` -------------------------------- ### Install Stirling PDF Helm Chart Source: https://docs.stirlingpdf.com/Installation/Kubernetes%20Install Installs the Stirling PDF Helm chart into a specified Kubernetes namespace. This involves adding the chart repository, updating local repository information, and then performing the installation. Ensure the namespace exists or is created during installation. ```bash helm repo add stirling-pdf https://stirling-tools.github.io/Stirling-PDF-chart helm repo update helm install stirling-pdf stirling-pdf/stirling-pdf-chart --namespace stirling-pdf --create-namespace ``` -------------------------------- ### Verify Calibre Installation in Docker Container Source: https://docs.stirlingpdf.com/Migration/Breaking-Changes This command verifies if the 'ebook-convert' executable, part of the Calibre suite, is installed within the Stirling PDF Docker container. It's a crucial step to ensure Calibre is available for PDF processing. ```bash docker exec stirling-pdf which ebook-convert ``` -------------------------------- ### Upgrade Stirling PDF Helm Chart Source: https://docs.stirlingpdf.com/Installation/Kubernetes%20Install Upgrades an existing Stirling PDF Helm chart installation to the latest version. This command first updates the local Helm repository cache and then performs the upgrade, reusing existing configuration values. It's crucial to run this in the same namespace as the original installation. ```bash helm repo update helm upgrade stirling-pdf stirling-pdf/stirling-pdf-chart --namespace stirling-pdf --reuse-values ``` -------------------------------- ### Verify Stirling PDF Installation Source: https://docs.stirlingpdf.com/Production-Deployment-Guide This snippet shows how to verify that Stirling PDF is running correctly after deployment. It includes commands to check if the container is active and to view its logs. It also provides the URL to access the Stirling PDF interface in a web browser. ```bash # Check if running docker ps | grep stirling-pdf # View logs docker logs -f stirling-pdf ``` -------------------------------- ### Create Desktop Entry for Stirling-PDF Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Generates a .desktop file to add Stirling-PDF to the application menu, allowing users to launch the WebGUI and the Java application simultaneously. ```bash location=$(pwd)/gradlew image=$(pwd)/docs/stirling-transparent.svg cat > ~/.local/share/applications/Stirling-PDF.desktop <
Custom content
``` -------------------------------- ### Update Docker Compose Image Tag (V1 to V2) Source: https://docs.stirlingpdf.com/Migration/Breaking-Changes This example demonstrates how to update the Docker Compose configuration to use the new V2 image tag for Stirling PDF. It shows the transition from the old 'stirlingtools/s-pdf' to the new 'stirlingtools/stirling-pdf' image. ```yaml services: stirling-pdf: image: stirlingtools/stirling-pdf:latest # NEW ``` -------------------------------- ### Configure Stirling PDF UI Settings (Docker Run) Source: https://docs.stirlingpdf.com/Configuration/UI%20Customisation This example illustrates how to pass Stirling PDF configuration settings as environment variables when running a Docker container. It covers application name, homepage description, navbar name, and update notification settings, ensuring the container starts with the desired configuration. ```bash -e UI_APPNAME=Stirling PDF \ -e UI_HOMEDESCRIPTION=Your locally hosted one-stop-shop for all your PDF needs. \ -e UI_APPNAVBARNAME=Stirling PDF \ -e SYSTEM_SHOWUPDATE=false \ -e SYSTEM_SHOWUPDATEONLYADMIN=false ``` -------------------------------- ### Install Tesseract OCR Language Packs on Debian-based Systems Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Updates package lists and provides commands to install Tesseract OCR language packs on Debian-based systems. It includes options to install all languages, find available languages, and view currently installed languages. ```shell sudo apt update &&\ # All languages # sudo apt install -y 'tesseract-ocr-*' # Find languages: apt search tesseract-ocr- # View installed languages: dpkg-query -W tesseract-ocr- | sed 's/tesseract-ocr-//g' ``` -------------------------------- ### Configure Stirling-PDF System Settings Source: https://docs.stirlingpdf.com/Production-Deployment-Guide Application-level settings to manage file size limits, connection timeouts, and concurrent operations for different deployment scales. ```yaml system: maxFileSize: 500 connectionTimeoutMinutes: 5 maxConcurrentOperations: 2 ``` -------------------------------- ### Create Stirling PDF Launch Script (Bash) Source: https://docs.stirlingpdf.com/Installation/Mac%20Installation This script automates the process of navigating to the Stirling PDF JAR file's directory and executing it. It requires the Stirling-PDF.jar to be in the Downloads directory. ```bash #!/bin/bash cd ~/Downloads # Change to where your JAR is located java -jar Stirling-PDF.jar ``` -------------------------------- ### Configure Stirling-PDF System Settings Source: https://docs.stirlingpdf.com/Production-Deployment-Guide Configuration snippets for setting the base URL and environment variables to ensure proper routing and CORS handling in Stirling-PDF. ```yaml System Settings: Root URI Path: / Frontend URL: https://pdf.yourcompany.com CORS Allowed Origins: https://pdf.yourcompany.com ``` ```yaml environment: - VITE_API_BASE_URL=https://pdf.yourcompany.com - SYSTEM_ROOTURIPATH=/ - SECURITY_CSRFDISABLED=false ``` -------------------------------- ### Manage Stirling-PDF as a Systemd Service Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Instructions for creating, enabling, and managing the Stirling-PDF background service on Linux systems. ```bash touch /opt/Stirling-PDF/.env nano /etc/systemd/system/stirlingpdf.service sudo systemctl daemon-reload sudo systemctl enable stirlingpdf.service sudo systemctl status stirlingpdf.service sudo systemctl start stirlingpdf.service sudo systemctl stop stirlingpdf.service sudo systemctl restart stirlingpdf.service ``` ```ini [Unit] Description=Stirling-PDF service After=syslog.target network.target [Service] SuccessExitStatus=143 User=root Group=root Type=simple EnvironmentFile=/opt/Stirling-PDF/.env WorkingDirectory=/opt/Stirling-PDF ExecStart=/usr/bin/java -jar Stirling-PDF-0.17.2.jar ExecStop=/bin/kill -15 $MAINPID [Install] WantedBy=multi-user.target ``` -------------------------------- ### Move Stirling PDF JAR and Scripts to Installation Directory (Nix) Source: https://docs.stirlingpdf.com/Installation/Unix%20Installation Moves the Stirling PDF JAR file to the current directory and prepares the scripts folder for use. This command is specific to non-root installations on Nix systems. ```shell mv ./build/libs/Stirling-PDF-*.jar ./Stirling-PDF-*.jar ``` -------------------------------- ### Apply Code Formatting with Spotless Source: https://docs.stirlingpdf.com/Installation/Development%20Setup Applies code formatting rules defined in the project using the Spotless Gradle plugin. This command should be run before committing changes to ensure code consistency. ```bash ./gradlew spotlessApply ``` -------------------------------- ### Example of Extracted SAML Attributes Source: https://docs.stirlingpdf.com/Configuration/SAML%20SSO%20Configuration This is an example log output showing the SAML attributes extracted during the authentication process. It helps in verifying that the Identity Provider (IdP) is sending the expected user information, such as username and email address. ```log Extracted SAML Attributes: {username=[john.doe], emailaddress=[john.doe@example.com], ...} ```