mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-05-22 01:42:00 +00:00
refactor: normalize line endings
This commit is contained in:
parent
3dd0471e22
commit
d725cf9a01
.gitignoreDockerfileEndpoint-groups.mdJenkinsfileVersion-groups.mdgradlew.bat
src/main/resources
messages_ar_AR.propertiesmessages_ca_CA.propertiesmessages_de_DE.propertiesmessages_es_ES.propertiesmessages_eu_ES.propertiesmessages_fr_FR.propertiesmessages_it_IT.propertiesmessages_ja_JP.propertiesmessages_ko_KR.propertiesmessages_pl_PL.propertiesmessages_ru_RU.propertiesmessages_sv_SE.propertiesmessages_zh_CN.properties
static
css
images/flags
js
templates/fragments
252
.gitignore
vendored
252
.gitignore
vendored
@ -1,127 +1,127 @@
|
|||||||
|
|
||||||
|
|
||||||
### Eclipse ###
|
### Eclipse ###
|
||||||
.metadata
|
.metadata
|
||||||
bin/
|
bin/
|
||||||
tmp/
|
tmp/
|
||||||
*.tmp
|
*.tmp
|
||||||
*.bak
|
*.bak
|
||||||
*.swp
|
*.swp
|
||||||
*~.nib
|
*~.nib
|
||||||
local.properties
|
local.properties
|
||||||
.settings/
|
.settings/
|
||||||
.loadpath
|
.loadpath
|
||||||
.recommenders
|
.recommenders
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
version.properties
|
version.properties
|
||||||
pipeline/watchedFolders/
|
pipeline/watchedFolders/
|
||||||
pipeline/finishedFolders/
|
pipeline/finishedFolders/
|
||||||
#### Stirling-PDF Files ###
|
#### Stirling-PDF Files ###
|
||||||
customFiles/
|
customFiles/
|
||||||
configs/
|
configs/
|
||||||
watchedFolders/
|
watchedFolders/
|
||||||
|
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
.gradle
|
.gradle
|
||||||
.lock
|
.lock
|
||||||
|
|
||||||
# External tool builders
|
# External tool builders
|
||||||
.externalToolBuilders/
|
.externalToolBuilders/
|
||||||
|
|
||||||
# Locally stored "Eclipse launch configurations"
|
# Locally stored "Eclipse launch configurations"
|
||||||
*.launch
|
*.launch
|
||||||
|
|
||||||
# PyDev specific (Python IDE for Eclipse)
|
# PyDev specific (Python IDE for Eclipse)
|
||||||
*.pydevproject
|
*.pydevproject
|
||||||
|
|
||||||
# CDT-specific (C/C++ Development Tooling)
|
# CDT-specific (C/C++ Development Tooling)
|
||||||
.cproject
|
.cproject
|
||||||
|
|
||||||
# CDT- autotools
|
# CDT- autotools
|
||||||
.autotools
|
.autotools
|
||||||
|
|
||||||
# Java annotation processor (APT)
|
# Java annotation processor (APT)
|
||||||
.factorypath
|
.factorypath
|
||||||
|
|
||||||
# PDT-specific (PHP Development Tools)
|
# PDT-specific (PHP Development Tools)
|
||||||
.buildpath
|
.buildpath
|
||||||
|
|
||||||
# sbteclipse plugin
|
# sbteclipse plugin
|
||||||
.target
|
.target
|
||||||
|
|
||||||
# Tern plugin
|
# Tern plugin
|
||||||
.tern-project
|
.tern-project
|
||||||
|
|
||||||
# TeXlipse plugin
|
# TeXlipse plugin
|
||||||
.texlipse
|
.texlipse
|
||||||
|
|
||||||
# STS (Spring Tool Suite)
|
# STS (Spring Tool Suite)
|
||||||
.springBeans
|
.springBeans
|
||||||
|
|
||||||
# Code Recommenders
|
# Code Recommenders
|
||||||
.recommenders/
|
.recommenders/
|
||||||
|
|
||||||
# Annotation Processing
|
# Annotation Processing
|
||||||
.apt_generated/
|
.apt_generated/
|
||||||
.apt_generated_test/
|
.apt_generated_test/
|
||||||
|
|
||||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||||
.cache-main
|
.cache-main
|
||||||
.scala_dependencies
|
.scala_dependencies
|
||||||
.worksheet
|
.worksheet
|
||||||
|
|
||||||
# Uncomment this line if you wish to ignore the project description file.
|
# Uncomment this line if you wish to ignore the project description file.
|
||||||
# Typically, this file would be tracked if it contains build/dependency configurations:
|
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||||
#.project
|
#.project
|
||||||
|
|
||||||
### Eclipse Patch ###
|
### Eclipse Patch ###
|
||||||
# Spring Boot Tooling
|
# Spring Boot Tooling
|
||||||
.sts4-cache/
|
.sts4-cache/
|
||||||
|
|
||||||
### Git ###
|
### Git ###
|
||||||
# Created by git for backups. To disable backups in Git:
|
# Created by git for backups. To disable backups in Git:
|
||||||
# $ git config --global mergetool.keepBackup false
|
# $ git config --global mergetool.keepBackup false
|
||||||
*.orig
|
*.orig
|
||||||
|
|
||||||
# Created by git when using merge tools for conflicts
|
# Created by git when using merge tools for conflicts
|
||||||
*.BACKUP.*
|
*.BACKUP.*
|
||||||
*.BASE.*
|
*.BASE.*
|
||||||
*.LOCAL.*
|
*.LOCAL.*
|
||||||
*.REMOTE.*
|
*.REMOTE.*
|
||||||
*_BACKUP_*.txt
|
*_BACKUP_*.txt
|
||||||
*_BASE_*.txt
|
*_BASE_*.txt
|
||||||
*_LOCAL_*.txt
|
*_LOCAL_*.txt
|
||||||
*_REMOTE_*.txt
|
*_REMOTE_*.txt
|
||||||
|
|
||||||
### Java ###
|
### Java ###
|
||||||
# Compiled class file
|
# Compiled class file
|
||||||
*.class
|
*.class
|
||||||
|
|
||||||
# Log file
|
# Log file
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
# BlueJ files
|
# BlueJ files
|
||||||
*.ctxt
|
*.ctxt
|
||||||
|
|
||||||
# Mobile Tools for Java (J2ME)
|
# Mobile Tools for Java (J2ME)
|
||||||
.mtj.tmp/
|
.mtj.tmp/
|
||||||
|
|
||||||
# Package Files #
|
# Package Files #
|
||||||
*.jar
|
*.jar
|
||||||
*.war
|
*.war
|
||||||
*.nar
|
*.nar
|
||||||
*.ear
|
*.ear
|
||||||
*.zip
|
*.zip
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.rar
|
*.rar
|
||||||
*.db
|
*.db
|
||||||
/build
|
/build
|
||||||
|
|
||||||
/.vscode
|
/.vscode
|
||||||
/.idea
|
/.idea
|
||||||
|
|
||||||
# Ignore Mac DS_Store files
|
# Ignore Mac DS_Store files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
**/.DS_Store
|
**/.DS_Store
|
138
Dockerfile
138
Dockerfile
@ -1,69 +1,69 @@
|
|||||||
# Main stage
|
# Main stage
|
||||||
FROM alpine:3.19.1
|
FROM alpine:3.19.1
|
||||||
|
|
||||||
# JDK for app
|
# JDK for app
|
||||||
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories && \
|
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories && \
|
||||||
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories && \
|
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories && \
|
||||||
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" | tee -a /etc/apk/repositories && \
|
echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" | tee -a /etc/apk/repositories && \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tzdata \
|
tzdata \
|
||||||
tini \
|
tini \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
openjdk17-jre \
|
openjdk17-jre \
|
||||||
# Doc conversion
|
# Doc conversion
|
||||||
libreoffice@testing \
|
libreoffice@testing \
|
||||||
# OCR MY PDF (unpaper for descew and other advanced featues)
|
# OCR MY PDF (unpaper for descew and other advanced featues)
|
||||||
ocrmypdf \
|
ocrmypdf \
|
||||||
tesseract-ocr-data-eng \
|
tesseract-ocr-data-eng \
|
||||||
# CV
|
# CV
|
||||||
py3-opencv \
|
py3-opencv \
|
||||||
# python3/pip
|
# python3/pip
|
||||||
python3 && \
|
python3 && \
|
||||||
wget https://bootstrap.pypa.io/get-pip.py -qO - | python3 - --break-system-packages --no-cache-dir --upgrade && \
|
wget https://bootstrap.pypa.io/get-pip.py -qO - | python3 - --break-system-packages --no-cache-dir --upgrade && \
|
||||||
# uno unoconv and HTML
|
# uno unoconv and HTML
|
||||||
pip install --break-system-packages --no-cache-dir --upgrade unoconv WeasyPrint && \
|
pip install --break-system-packages --no-cache-dir --upgrade unoconv WeasyPrint && \
|
||||||
mv /usr/share/tessdata /usr/share/tessdata-original
|
mv /usr/share/tessdata /usr/share/tessdata-original
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ARG VERSION_TAG
|
ARG VERSION_TAG
|
||||||
|
|
||||||
# Set Environment Variables
|
# Set Environment Variables
|
||||||
ENV DOCKER_ENABLE_SECURITY=false \
|
ENV DOCKER_ENABLE_SECURITY=false \
|
||||||
HOME=/home/stirlingpdfuser \
|
HOME=/home/stirlingpdfuser \
|
||||||
VERSION_TAG=$VERSION_TAG \
|
VERSION_TAG=$VERSION_TAG \
|
||||||
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75"
|
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75"
|
||||||
# PUID=1000 \
|
# PUID=1000 \
|
||||||
# PGID=1000 \
|
# PGID=1000 \
|
||||||
# UMASK=022 \
|
# UMASK=022 \
|
||||||
|
|
||||||
# Copy necessary files
|
# Copy necessary files
|
||||||
COPY scripts /scripts
|
COPY scripts /scripts
|
||||||
COPY pipeline /pipeline
|
COPY pipeline /pipeline
|
||||||
COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto
|
COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto
|
||||||
COPY src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto
|
COPY src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto
|
||||||
COPY build/libs/*.jar app.jar
|
COPY build/libs/*.jar app.jar
|
||||||
|
|
||||||
# Create user and group
|
# Create user and group
|
||||||
##RUN groupadd -g $PGID stirlingpdfgroup && \
|
##RUN groupadd -g $PGID stirlingpdfgroup && \
|
||||||
## useradd -u $PUID -g stirlingpdfgroup -s /bin/sh stirlingpdfuser && \
|
## useradd -u $PUID -g stirlingpdfgroup -s /bin/sh stirlingpdfuser && \
|
||||||
## mkdir -p $HOME && chown stirlingpdfuser:stirlingpdfgroup $HOME && \
|
## mkdir -p $HOME && chown stirlingpdfuser:stirlingpdfgroup $HOME && \
|
||||||
# Set up necessary directories and permissions
|
# Set up necessary directories and permissions
|
||||||
RUN mkdir -p /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders && \
|
RUN mkdir -p /configs /logs /customFiles /pipeline/watchedFolders /pipeline/finishedFolders && \
|
||||||
##&& \
|
##&& \
|
||||||
## chown -R stirlingpdfuser:stirlingpdfgroup /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /customFiles && \
|
## chown -R stirlingpdfuser:stirlingpdfgroup /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /customFiles && \
|
||||||
## chown -R stirlingpdfuser:stirlingpdfgroup /usr/share/tesseract-ocr-original && \
|
## chown -R stirlingpdfuser:stirlingpdfgroup /usr/share/tesseract-ocr-original && \
|
||||||
# Set font cache and permissions
|
# Set font cache and permissions
|
||||||
fc-cache -f -v && \
|
fc-cache -f -v && \
|
||||||
chmod +x /scripts/*
|
chmod +x /scripts/*
|
||||||
## chown stirlingpdfuser:stirlingpdfgroup /app.jar && \
|
## chown stirlingpdfuser:stirlingpdfgroup /app.jar && \
|
||||||
## chmod +x /scripts/init.sh
|
## chmod +x /scripts/init.sh
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Set user and run command
|
# Set user and run command
|
||||||
##USER stirlingpdfuser
|
##USER stirlingpdfuser
|
||||||
ENTRYPOINT ["tini", "--", "/scripts/init.sh"]
|
ENTRYPOINT ["tini", "--", "/scripts/init.sh"]
|
||||||
CMD ["java", "-Dfile.encoding=UTF-8", "-jar", "/app.jar"]
|
CMD ["java", "-Dfile.encoding=UTF-8", "-jar", "/app.jar"]
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
| Operation | PageOps | Convert | Security | Other | CLI | Python | OpenCV | LibreOffice | OCRmyPDF | Java | Javascript |
|
| Operation | PageOps | Convert | Security | Other | CLI | Python | OpenCV | LibreOffice | OCRmyPDF | Java | Javascript |
|
||||||
|---------------------|---------|---------|----------|-------|------|--------|--------|-------------|----------|----------|------------|
|
|---------------------|---------|---------|----------|-------|------|--------|--------|-------------|----------|----------|------------|
|
||||||
| adjust-contrast | ✔️ | | | | | | | | | | ✔️ |
|
| adjust-contrast | ✔️ | | | | | | | | | | ✔️ |
|
||||||
| auto-split-pdf | ✔️ | | | | | | | | | ✔️ | |
|
| auto-split-pdf | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| crop | ✔️ | | | | | | | | | ✔️ | |
|
| crop | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| extract-page | ✔️ | | | | | | | | | ✔️ | |
|
| extract-page | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| merge-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
| merge-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| multi-page-layout | ✔️ | | | | | | | | | ✔️ | |
|
| multi-page-layout | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| pdf-organizer | ✔️ | | | | | | | | | ✔️ | ✔️ |
|
| pdf-organizer | ✔️ | | | | | | | | | ✔️ | ✔️ |
|
||||||
| pdf-to-single-page | ✔️ | | | | | | | | | ✔️ | |
|
| pdf-to-single-page | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| remove-pages | ✔️ | | | | | | | | | ✔️ | |
|
| remove-pages | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| rotate-pdf | ✔️ | | | | | | | | | ✔️ | |
|
| rotate-pdf | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| scale-pages | ✔️ | | | | | | | | | ✔️ | |
|
| scale-pages | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| split-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
| split-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
||||||
| file-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| file-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| img-to-pdf | | ✔️ | | | | | | | | ✔️ | |
|
| img-to-pdf | | ✔️ | | | | | | | | ✔️ | |
|
||||||
| pdf-to-html | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| pdf-to-html | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| pdf-to-img | | ✔️ | | | | | | | | ✔️ | |
|
| pdf-to-img | | ✔️ | | | | | | | | ✔️ | |
|
||||||
| pdf-to-pdfa | | ✔️ | | | ✔️ | | | | ✔️ | | |
|
| pdf-to-pdfa | | ✔️ | | | ✔️ | | | | ✔️ | | |
|
||||||
| pdf-to-markdown | | ✔️ | | | | | | | | ✔️ | |
|
| pdf-to-markdown | | ✔️ | | | | | | | | ✔️ | |
|
||||||
| pdf-to-presentation | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| pdf-to-presentation | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| pdf-to-text | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| pdf-to-text | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| pdf-to-word | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| pdf-to-word | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| pdf-to-xml | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| pdf-to-xml | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| xlsx-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
| xlsx-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
| add-password | | | ✔️ | | | | | | | ✔️ | |
|
| add-password | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| add-watermark | | | ✔️ | | | | | | | ✔️ | |
|
| add-watermark | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| cert-sign | | | ✔️ | | | | | | | ✔️ | |
|
| cert-sign | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| change-permissions | | | ✔️ | | | | | | | ✔️ | |
|
| change-permissions | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| remove-password | | | ✔️ | | | | | | | ✔️ | |
|
| remove-password | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| sanitize-pdf | | | ✔️ | | | | | | | ✔️ | |
|
| sanitize-pdf | | | ✔️ | | | | | | | ✔️ | |
|
||||||
| add-image | | | | ✔️ | | | | | | ✔️ | |
|
| add-image | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| add-page-numbers | | | | ✔️ | | | | | | ✔️ | |
|
| add-page-numbers | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| auto-rename | | | | ✔️ | | | | | | ✔️ | |
|
| auto-rename | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| change-metadata | | | | ✔️ | | | | | | ✔️ | |
|
| change-metadata | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| compare | | | | ✔️ | | | | | | | ✔️ |
|
| compare | | | | ✔️ | | | | | | | ✔️ |
|
||||||
| compress-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
| compress-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
||||||
| extract-image-scans | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
| extract-image-scans | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
||||||
| extract-images | | | | ✔️ | | | | | | ✔️ | |
|
| extract-images | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| flatten | | | | ✔️ | | | | | | | ✔️ |
|
| flatten | | | | ✔️ | | | | | | | ✔️ |
|
||||||
| get-info-on-pdf | | | | ✔️ | | | | | | ✔️ | |
|
| get-info-on-pdf | | | | ✔️ | | | | | | ✔️ | |
|
||||||
| ocr-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
| ocr-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
||||||
| remove-blanks | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
| remove-blanks | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
||||||
| repair | | | | ✔️ | ✔️ | | | ✔️ | | | |
|
| repair | | | | ✔️ | ✔️ | | | ✔️ | | | |
|
||||||
| show-javascript | | | | ✔️ | | | | | | | ✔️ |
|
| show-javascript | | | | ✔️ | | | | | | | ✔️ |
|
||||||
| sign | | | | ✔️ | | | | | | | ✔️ |
|
| sign | | | | ✔️ | | | | | | | ✔️ |
|
88
Jenkinsfile
vendored
88
Jenkinsfile
vendored
@ -1,45 +1,45 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod 755 gradlew'
|
sh 'chmod 755 gradlew'
|
||||||
sh './gradlew build'
|
sh './gradlew build'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docker Build') {
|
stage('Docker Build') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def appVersion = sh(returnStdout: true, script: './gradlew printVersion -q').trim()
|
def appVersion = sh(returnStdout: true, script: './gradlew printVersion -q').trim()
|
||||||
def image = "frooodle/s-pdf:$appVersion"
|
def image = "frooodle/s-pdf:$appVersion"
|
||||||
sh "docker build -t $image ."
|
sh "docker build -t $image ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docker Push') {
|
stage('Docker Push') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def appVersion = sh(returnStdout: true, script: './gradlew printVersion -q').trim()
|
def appVersion = sh(returnStdout: true, script: './gradlew printVersion -q').trim()
|
||||||
def image = "frooodle/s-pdf:$appVersion"
|
def image = "frooodle/s-pdf:$appVersion"
|
||||||
withCredentials([string(credentialsId: 'docker_hub_access_token', variable: 'DOCKER_HUB_ACCESS_TOKEN')]) {
|
withCredentials([string(credentialsId: 'docker_hub_access_token', variable: 'DOCKER_HUB_ACCESS_TOKEN')]) {
|
||||||
sh "docker login --username frooodle --password $DOCKER_HUB_ACCESS_TOKEN"
|
sh "docker login --username frooodle --password $DOCKER_HUB_ACCESS_TOKEN"
|
||||||
sh "docker push $image"
|
sh "docker push $image"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Helm Push') {
|
stage('Helm Push') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
//TODO: Read chartVersion from Chart.yaml
|
//TODO: Read chartVersion from Chart.yaml
|
||||||
def chartVersion = '1.0.0'
|
def chartVersion = '1.0.0'
|
||||||
withCredentials([string(credentialsId: 'docker_hub_access_token', variable: 'DOCKER_HUB_ACCESS_TOKEN')]) {
|
withCredentials([string(credentialsId: 'docker_hub_access_token', variable: 'DOCKER_HUB_ACCESS_TOKEN')]) {
|
||||||
sh "docker login --username frooodle --password $DOCKER_HUB_ACCESS_TOKEN"
|
sh "docker login --username frooodle --password $DOCKER_HUB_ACCESS_TOKEN"
|
||||||
sh "helm package chart/stirling-pdf"
|
sh "helm package chart/stirling-pdf"
|
||||||
sh "helm push stirling-pdf-chart-1.0.0.tgz oci://registry-1.docker.io/frooodle"
|
sh "helm push stirling-pdf-chart-1.0.0.tgz oci://registry-1.docker.io/frooodle"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,64 +1,64 @@
|
|||||||
|Technology | Ultra-Lite | Lite | Full |
|
|Technology | Ultra-Lite | Lite | Full |
|
||||||
|----------------|:----------:|:----:|:----:|
|
|----------------|:----------:|:----:|:----:|
|
||||||
| Java | ✔️ | ✔️ | ✔️ |
|
| Java | ✔️ | ✔️ | ✔️ |
|
||||||
| JavaScript | ✔️ | ✔️ | ✔️ |
|
| JavaScript | ✔️ | ✔️ | ✔️ |
|
||||||
| Libre | | ✔️ | ✔️ |
|
| Libre | | ✔️ | ✔️ |
|
||||||
| Python | | | ✔️ |
|
| Python | | | ✔️ |
|
||||||
| OpenCV | | | ✔️ |
|
| OpenCV | | | ✔️ |
|
||||||
| OCRmyPDF | | | ✔️ |
|
| OCRmyPDF | | | ✔️ |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Operation | Ultra-Lite | Lite | Full
|
Operation | Ultra-Lite | Lite | Full
|
||||||
--------------------|------------|------|-----
|
--------------------|------------|------|-----
|
||||||
add-page-numbers | ✔️ | ✔️ | ✔️
|
add-page-numbers | ✔️ | ✔️ | ✔️
|
||||||
add-password | ✔️ | ✔️ | ✔️
|
add-password | ✔️ | ✔️ | ✔️
|
||||||
add-image | ✔️ | ✔️ | ✔️
|
add-image | ✔️ | ✔️ | ✔️
|
||||||
add-watermark | ✔️ | ✔️ | ✔️
|
add-watermark | ✔️ | ✔️ | ✔️
|
||||||
adjust-contrast | ✔️ | ✔️ | ✔️
|
adjust-contrast | ✔️ | ✔️ | ✔️
|
||||||
auto-split-pdf | ✔️ | ✔️ | ✔️
|
auto-split-pdf | ✔️ | ✔️ | ✔️
|
||||||
auto-redact | ✔️ | ✔️ | ✔️
|
auto-redact | ✔️ | ✔️ | ✔️
|
||||||
auto-rename | ✔️ | ✔️ | ✔️
|
auto-rename | ✔️ | ✔️ | ✔️
|
||||||
cert-sign | ✔️ | ✔️ | ✔️
|
cert-sign | ✔️ | ✔️ | ✔️
|
||||||
crop | ✔️ | ✔️ | ✔️
|
crop | ✔️ | ✔️ | ✔️
|
||||||
change-metadata | ✔️ | ✔️ | ✔️
|
change-metadata | ✔️ | ✔️ | ✔️
|
||||||
change-permissions | ✔️ | ✔️ | ✔️
|
change-permissions | ✔️ | ✔️ | ✔️
|
||||||
compare | ✔️ | ✔️ | ✔️
|
compare | ✔️ | ✔️ | ✔️
|
||||||
extract-page | ✔️ | ✔️ | ✔️
|
extract-page | ✔️ | ✔️ | ✔️
|
||||||
extract-images | ✔️ | ✔️ | ✔️
|
extract-images | ✔️ | ✔️ | ✔️
|
||||||
flatten | ✔️ | ✔️ | ✔️
|
flatten | ✔️ | ✔️ | ✔️
|
||||||
get-info-on-pdf | ✔️ | ✔️ | ✔️
|
get-info-on-pdf | ✔️ | ✔️ | ✔️
|
||||||
img-to-pdf | ✔️ | ✔️ | ✔️
|
img-to-pdf | ✔️ | ✔️ | ✔️
|
||||||
markdown-to-pdf | ✔️ | ✔️ | ✔️
|
markdown-to-pdf | ✔️ | ✔️ | ✔️
|
||||||
merge-pdfs | ✔️ | ✔️ | ✔️
|
merge-pdfs | ✔️ | ✔️ | ✔️
|
||||||
multi-page-layout | ✔️ | ✔️ | ✔️
|
multi-page-layout | ✔️ | ✔️ | ✔️
|
||||||
overlay-pdf | ✔️ | ✔️ | ✔️
|
overlay-pdf | ✔️ | ✔️ | ✔️
|
||||||
pdf-organizer | ✔️ | ✔️ | ✔️
|
pdf-organizer | ✔️ | ✔️ | ✔️
|
||||||
pdf-to-csv | ✔️ | ✔️ | ✔️
|
pdf-to-csv | ✔️ | ✔️ | ✔️
|
||||||
pdf-to-img | ✔️ | ✔️ | ✔️
|
pdf-to-img | ✔️ | ✔️ | ✔️
|
||||||
pdf-to-single-page | ✔️ | ✔️ | ✔️
|
pdf-to-single-page | ✔️ | ✔️ | ✔️
|
||||||
remove-pages | ✔️ | ✔️ | ✔️
|
remove-pages | ✔️ | ✔️ | ✔️
|
||||||
remove-password | ✔️ | ✔️ | ✔️
|
remove-password | ✔️ | ✔️ | ✔️
|
||||||
rotate-pdf | ✔️ | ✔️ | ✔️
|
rotate-pdf | ✔️ | ✔️ | ✔️
|
||||||
sanitize-pdf | ✔️ | ✔️ | ✔️
|
sanitize-pdf | ✔️ | ✔️ | ✔️
|
||||||
scale-pages | ✔️ | ✔️ | ✔️
|
scale-pages | ✔️ | ✔️ | ✔️
|
||||||
sign | ✔️ | ✔️ | ✔️
|
sign | ✔️ | ✔️ | ✔️
|
||||||
show-javascript | ✔️ | ✔️ | ✔️
|
show-javascript | ✔️ | ✔️ | ✔️
|
||||||
split-by-size-or-count | ✔️ | ✔️ | ✔️
|
split-by-size-or-count | ✔️ | ✔️ | ✔️
|
||||||
split-pdf-by-sections | ✔️ | ✔️ | ✔️
|
split-pdf-by-sections | ✔️ | ✔️ | ✔️
|
||||||
split-pdfs | ✔️ | ✔️ | ✔️
|
split-pdfs | ✔️ | ✔️ | ✔️
|
||||||
file-to-pdf | | ✔️ | ✔️
|
file-to-pdf | | ✔️ | ✔️
|
||||||
pdf-to-html | | ✔️ | ✔️
|
pdf-to-html | | ✔️ | ✔️
|
||||||
pdf-to-presentation | | ✔️ | ✔️
|
pdf-to-presentation | | ✔️ | ✔️
|
||||||
pdf-to-text | | ✔️ | ✔️
|
pdf-to-text | | ✔️ | ✔️
|
||||||
pdf-to-word | | ✔️ | ✔️
|
pdf-to-word | | ✔️ | ✔️
|
||||||
pdf-to-xml | | ✔️ | ✔️
|
pdf-to-xml | | ✔️ | ✔️
|
||||||
repair | | ✔️ | ✔️
|
repair | | ✔️ | ✔️
|
||||||
xlsx-to-pdf | | ✔️ | ✔️
|
xlsx-to-pdf | | ✔️ | ✔️
|
||||||
compress-pdf | | | ✔️
|
compress-pdf | | | ✔️
|
||||||
extract-image-scans | | | ✔️
|
extract-image-scans | | | ✔️
|
||||||
ocr-pdf | | | ✔️
|
ocr-pdf | | | ✔️
|
||||||
pdf-to-pdfa | | | ✔️
|
pdf-to-pdfa | | | ✔️
|
||||||
remove-blanks | | | ✔️
|
remove-blanks | | | ✔️
|
||||||
|
182
gradlew.bat
vendored
182
gradlew.bat
vendored
@ -1,91 +1,91 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
exit /b %EXIT_CODE%
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
:omega
|
:omega
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,135 +1,135 @@
|
|||||||
/* Dark Mode Styles */
|
/* Dark Mode Styles */
|
||||||
body, select, textarea {
|
body, select, textarea {
|
||||||
--body-background-color: 51, 51, 51;
|
--body-background-color: 51, 51, 51;
|
||||||
--base-font-color: 255, 255, 255;
|
--base-font-color: 255, 255, 255;
|
||||||
background-color: rgb(var(--body-background-color)) !important;
|
background-color: rgb(var(--body-background-color)) !important;
|
||||||
color: rgb(var(--base-font-color)) !important;
|
color: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
background-color: rgb(var(--body-background-color)) !important;
|
background-color: rgb(var(--body-background-color)) !important;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
color: rgb(var(--base-font-color)) !important;
|
color: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #add8e6;
|
color: #add8e6;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #87ceeb; /* Slightly brighter blue on hover for accessibility */
|
color: #87ceeb; /* Slightly brighter blue on hover for accessibility */
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark-card {
|
.dark-card {
|
||||||
background-color: rgb(var(--body-background-color)) !important;
|
background-color: rgb(var(--body-background-color)) !important;
|
||||||
color: rgb(var(--base-font-color)) !important;
|
color: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
.jumbotron {
|
.jumbotron {
|
||||||
background-color: #222; /* or any other dark color */
|
background-color: #222; /* or any other dark color */
|
||||||
color: rgb(var(--base-font-color)) !important; /* or any other light color */
|
color: rgb(var(--base-font-color)) !important; /* or any other light color */
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group {
|
.list-group {
|
||||||
background-color: #222 !important;
|
background-color: #222 !important;
|
||||||
color: rgb(var(--base-font-color)) !important;
|
color: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
background-color: #222 !important;
|
background-color: #222 !important;
|
||||||
color: rgb(var(--base-font-color)) !important;
|
color: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
#support-section {
|
#support-section {
|
||||||
background-color: #444 !important;
|
background-color: #444 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pages-container-wrapper {
|
#pages-container-wrapper {
|
||||||
--background-color: rgba(255, 255, 255, 0.046) !important;
|
--background-color: rgba(255, 255, 255, 0.046) !important;
|
||||||
--scroll-bar-color: #4c4c4c !important;
|
--scroll-bar-color: #4c4c4c !important;
|
||||||
--scroll-bar-thumb: #d3d3d3 !important;
|
--scroll-bar-thumb: #d3d3d3 !important;
|
||||||
--scroll-bar-thumb-hover: rgb(var(--base-font-color)) !important;
|
--scroll-bar-thumb-hover: rgb(var(--base-font-color)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.favorite-icon img {
|
.favorite-icon img {
|
||||||
filter: brightness(0) invert(1) !important;
|
filter: brightness(0) invert(1) !important;
|
||||||
}
|
}
|
||||||
table thead {
|
table thead {
|
||||||
background-color: #333 !important;
|
background-color: #333 !important;
|
||||||
border: 1px solid #444;
|
border: 1px solid #444;
|
||||||
}
|
}
|
||||||
table th, table td {
|
table th, table td {
|
||||||
border: 1px solid #444 !important;
|
border: 1px solid #444 !important;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.btn {
|
.btn {
|
||||||
background-color: #444 !important;
|
background-color: #444 !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-color: #007bff !important;
|
background-color: #007bff !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
.btn-secondary {
|
.btn-secondary {
|
||||||
background-color: #6c757d !important;
|
background-color: #6c757d !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
.btn-info {
|
.btn-info {
|
||||||
background-color: #17a2b8 !important;
|
background-color: #17a2b8 !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
.btn-danger {
|
.btn-danger {
|
||||||
background-color: #dc3545 !important;
|
background-color: #dc3545 !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-warning {
|
.btn-warning {
|
||||||
background-color: #ffc107 !important;
|
background-color: #ffc107 !important;
|
||||||
border: none;
|
border: none;
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-secondary {
|
.btn-outline-secondary {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
border-color: #fff;
|
border-color: #fff;
|
||||||
}
|
}
|
||||||
.btn-outline-secondary:hover {
|
.btn-outline-secondary:hover {
|
||||||
background-color: #444 !important;
|
background-color: #444 !important;
|
||||||
color: #007bff !important;
|
color: #007bff !important;
|
||||||
border-color: #007bff;
|
border-color: #007bff;
|
||||||
}
|
}
|
||||||
.blackwhite-icon {
|
.blackwhite-icon {
|
||||||
filter: brightness(0) invert(1);
|
filter: brightness(0) invert(1);
|
||||||
}
|
}
|
||||||
hr {
|
hr {
|
||||||
border-color: rgba(255, 255, 255, 0.6); /* semi-transparent white */
|
border-color: rgba(255, 255, 255, 0.6); /* semi-transparent white */
|
||||||
background-color: rgba(255, 255, 255, 0.6); /* for some browsers that might use background instead of border for <hr> */
|
background-color: rgba(255, 255, 255, 0.6); /* for some browsers that might use background instead of border for <hr> */
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
border-color: #fff;
|
border-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#global-buttons-container input {
|
#global-buttons-container input {
|
||||||
background-color: #323948;
|
background-color: #323948;
|
||||||
caret-color: #ffffff;
|
caret-color: #ffffff;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
#global-buttons-container input::placeholder {
|
#global-buttons-container input::placeholder {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#global-buttons-container input:disabled::-webkit-input-placeholder { /* WebKit browsers */
|
#global-buttons-container input:disabled::-webkit-input-placeholder { /* WebKit browsers */
|
||||||
color: #6E6865;
|
color: #6E6865;
|
||||||
}
|
}
|
||||||
#global-buttons-container input:disabled:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
#global-buttons-container input:disabled:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
||||||
color: #6E6865;
|
color: #6E6865;
|
||||||
}
|
}
|
||||||
#global-buttons-container input:disabled::-moz-placeholder { /* Mozilla Firefox 19+ */
|
#global-buttons-container input:disabled::-moz-placeholder { /* Mozilla Firefox 19+ */
|
||||||
color: #6E6865;
|
color: #6E6865;
|
||||||
}
|
}
|
||||||
#global-buttons-container input:disabled:-ms-input-placeholder { /* Internet Explorer 10+ */
|
#global-buttons-container input:disabled:-ms-input-placeholder { /* Internet Explorer 10+ */
|
||||||
color: #6E6865;
|
color: #6E6865;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,94 +1,94 @@
|
|||||||
#page-container {
|
#page-container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content-wrap {
|
#content-wrap {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.navbar {
|
.navbar {
|
||||||
height: auto; /* Adjusts height automatically based on content */
|
height: auto; /* Adjusts height automatically based on content */
|
||||||
white-space: nowrap; /* Prevents wrapping of navbar contents */
|
white-space: nowrap; /* Prevents wrapping of navbar contents */
|
||||||
}
|
}
|
||||||
/* TODO enable later
|
/* TODO enable later
|
||||||
.navbar .container {
|
.navbar .container {
|
||||||
|
|
||||||
|
|
||||||
max-width: 100%; //Allows the container to expand up to full width
|
max-width: 100%; //Allows the container to expand up to full width
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
html[lang-direction=ltr] * {
|
html[lang-direction=ltr] * {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
}
|
}
|
||||||
html[lang-direction=rtl] * {
|
html[lang-direction=rtl] * {
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.ignore-rtl {
|
.ignore-rtl {
|
||||||
direction: ltr !important;
|
direction: ltr !important;
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.align-top {
|
.align-top {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.align-center-right {
|
.align-center-right {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.align-center-left {
|
.align-center-left {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.align-bottom {
|
.align-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-group > label:first-of-type {
|
.btn-group > label:first-of-type {
|
||||||
border-top-left-radius: 0.25rem !important;
|
border-top-left-radius: 0.25rem !important;
|
||||||
border-bottom-left-radius: 0.25rem !important;
|
border-bottom-left-radius: 0.25rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[lang-direction="rtl"] input.form-check-input {
|
html[lang-direction="rtl"] input.form-check-input {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
}
|
}
|
||||||
html[lang-direction="rtl"] label.form-check-label {
|
html[lang-direction="rtl"] label.form-check-label {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.margin-auto-parent {
|
.margin-auto-parent {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.margin-center {
|
.margin-center {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
#pdf-canvas {
|
#pdf-canvas {
|
||||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.fixed-shadow-canvas {
|
.fixed-shadow-canvas {
|
||||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.shadow-canvas {
|
.shadow-canvas {
|
||||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.384);
|
||||||
}
|
}
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
@ -1,29 +1,29 @@
|
|||||||
.list-group-item {
|
.list-group-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filename {
|
.filename {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrows {
|
.arrows {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.arrows .btn {
|
.arrows .btn {
|
||||||
margin: 0 3px;
|
margin: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.move-up span,
|
.move-up span,
|
||||||
.move-down span {
|
.move-down span {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1235" height="650" viewBox="0 0 7410 3900">
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1235" height="650" viewBox="0 0 7410 3900">
|
||||||
<rect width="7410" height="3900" fill="#b22234"/>
|
<rect width="7410" height="3900" fill="#b22234"/>
|
||||||
<path d="M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0" stroke="#fff" stroke-width="300"/>
|
<path d="M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0" stroke="#fff" stroke-width="300"/>
|
||||||
<rect width="2964" height="2100" fill="#3c3b6e"/>
|
<rect width="2964" height="2100" fill="#3c3b6e"/>
|
||||||
<g fill="#fff">
|
<g fill="#fff">
|
||||||
<g id="s18">
|
<g id="s18">
|
||||||
<g id="s9">
|
<g id="s9">
|
||||||
<g id="s5">
|
<g id="s5">
|
||||||
<g id="s4">
|
<g id="s4">
|
||||||
<path id="s" d="M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"/>
|
<path id="s" d="M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"/>
|
||||||
<use xlink:href="#s" y="420"/>
|
<use xlink:href="#s" y="420"/>
|
||||||
<use xlink:href="#s" y="840"/>
|
<use xlink:href="#s" y="840"/>
|
||||||
<use xlink:href="#s" y="1260"/>
|
<use xlink:href="#s" y="1260"/>
|
||||||
</g>
|
</g>
|
||||||
<use xlink:href="#s" y="1680"/>
|
<use xlink:href="#s" y="1680"/>
|
||||||
</g>
|
</g>
|
||||||
<use xlink:href="#s4" x="247" y="210"/>
|
<use xlink:href="#s4" x="247" y="210"/>
|
||||||
</g>
|
</g>
|
||||||
<use xlink:href="#s9" x="494"/>
|
<use xlink:href="#s9" x="494"/>
|
||||||
</g>
|
</g>
|
||||||
<use xlink:href="#s18" x="988"/>
|
<use xlink:href="#s18" x="988"/>
|
||||||
<use xlink:href="#s9" x="1976"/>
|
<use xlink:href="#s9" x="1976"/>
|
||||||
<use xlink:href="#s5" x="2470"/>
|
<use xlink:href="#s5" x="2470"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before (image error) Size: 899 B After (image error) Size: 874 B |
@ -1,285 +1,285 @@
|
|||||||
class PdfContainer {
|
class PdfContainer {
|
||||||
fileName;
|
fileName;
|
||||||
pagesContainer;
|
pagesContainer;
|
||||||
pagesContainerWrapper;
|
pagesContainerWrapper;
|
||||||
pdfAdapters;
|
pdfAdapters;
|
||||||
downloadLink;
|
downloadLink;
|
||||||
|
|
||||||
constructor(id, wrapperId, pdfAdapters) {
|
constructor(id, wrapperId, pdfAdapters) {
|
||||||
this.pagesContainer = document.getElementById(id)
|
this.pagesContainer = document.getElementById(id)
|
||||||
this.pagesContainerWrapper = document.getElementById(wrapperId);
|
this.pagesContainerWrapper = document.getElementById(wrapperId);
|
||||||
this.downloadLink = null;
|
this.downloadLink = null;
|
||||||
this.movePageTo = this.movePageTo.bind(this);
|
this.movePageTo = this.movePageTo.bind(this);
|
||||||
this.addPdfs = this.addPdfs.bind(this);
|
this.addPdfs = this.addPdfs.bind(this);
|
||||||
this.addPdfsFromFiles = this.addPdfsFromFiles.bind(this);
|
this.addPdfsFromFiles = this.addPdfsFromFiles.bind(this);
|
||||||
this.rotateElement = this.rotateElement.bind(this);
|
this.rotateElement = this.rotateElement.bind(this);
|
||||||
this.rotateAll = this.rotateAll.bind(this);
|
this.rotateAll = this.rotateAll.bind(this);
|
||||||
this.exportPdf = this.exportPdf.bind(this);
|
this.exportPdf = this.exportPdf.bind(this);
|
||||||
this.updateFilename = this.updateFilename.bind(this);
|
this.updateFilename = this.updateFilename.bind(this);
|
||||||
this.setDownloadAttribute = this.setDownloadAttribute.bind(this);
|
this.setDownloadAttribute = this.setDownloadAttribute.bind(this);
|
||||||
this.preventIllegalChars = this.preventIllegalChars.bind(this);
|
this.preventIllegalChars = this.preventIllegalChars.bind(this);
|
||||||
|
|
||||||
this.pdfAdapters = pdfAdapters;
|
this.pdfAdapters = pdfAdapters;
|
||||||
|
|
||||||
this.pdfAdapters.forEach(adapter => {
|
this.pdfAdapters.forEach(adapter => {
|
||||||
adapter.setActions({
|
adapter.setActions({
|
||||||
movePageTo: this.movePageTo,
|
movePageTo: this.movePageTo,
|
||||||
addPdfs: this.addPdfs,
|
addPdfs: this.addPdfs,
|
||||||
rotateElement: this.rotateElement,
|
rotateElement: this.rotateElement,
|
||||||
updateFilename: this.updateFilename
|
updateFilename: this.updateFilename
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
window.addPdfs = this.addPdfs;
|
window.addPdfs = this.addPdfs;
|
||||||
window.exportPdf = this.exportPdf;
|
window.exportPdf = this.exportPdf;
|
||||||
window.rotateAll = this.rotateAll;
|
window.rotateAll = this.rotateAll;
|
||||||
|
|
||||||
const filenameInput = document.getElementById('filename-input');
|
const filenameInput = document.getElementById('filename-input');
|
||||||
const downloadBtn = document.getElementById('export-button');
|
const downloadBtn = document.getElementById('export-button');
|
||||||
|
|
||||||
filenameInput.onkeyup = this.updateFilename;
|
filenameInput.onkeyup = this.updateFilename;
|
||||||
filenameInput.onkeydown = this.preventIllegalChars;
|
filenameInput.onkeydown = this.preventIllegalChars;
|
||||||
filenameInput.disabled = false;
|
filenameInput.disabled = false;
|
||||||
filenameInput.innerText = "";
|
filenameInput.innerText = "";
|
||||||
downloadBtn.disabled = true;
|
downloadBtn.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
movePageTo(startElement, endElement, scrollTo = false) {
|
movePageTo(startElement, endElement, scrollTo = false) {
|
||||||
const childArray = Array.from(this.pagesContainer.childNodes);
|
const childArray = Array.from(this.pagesContainer.childNodes);
|
||||||
const startIndex = childArray.indexOf(startElement);
|
const startIndex = childArray.indexOf(startElement);
|
||||||
const endIndex = childArray.indexOf(endElement);
|
const endIndex = childArray.indexOf(endElement);
|
||||||
this.pagesContainer.removeChild(startElement);
|
this.pagesContainer.removeChild(startElement);
|
||||||
if(!endElement) {
|
if(!endElement) {
|
||||||
this.pagesContainer.append(startElement);
|
this.pagesContainer.append(startElement);
|
||||||
} else {
|
} else {
|
||||||
this.pagesContainer.insertBefore(startElement, endElement);
|
this.pagesContainer.insertBefore(startElement, endElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(scrollTo) {
|
if(scrollTo) {
|
||||||
const { width } = startElement.getBoundingClientRect();
|
const { width } = startElement.getBoundingClientRect();
|
||||||
const vector = (endIndex !== -1 && startIndex > endIndex)
|
const vector = (endIndex !== -1 && startIndex > endIndex)
|
||||||
? 0-width
|
? 0-width
|
||||||
: width;
|
: width;
|
||||||
|
|
||||||
this.pagesContainerWrapper.scroll({
|
this.pagesContainerWrapper.scroll({
|
||||||
left: this.pagesContainerWrapper.scrollLeft + vector,
|
left: this.pagesContainerWrapper.scrollLeft + vector,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addPdfs(nextSiblingElement) {
|
addPdfs(nextSiblingElement) {
|
||||||
var input = document.createElement('input');
|
var input = document.createElement('input');
|
||||||
input.type = 'file';
|
input.type = 'file';
|
||||||
input.multiple = true;
|
input.multiple = true;
|
||||||
input.setAttribute("accept", "application/pdf");
|
input.setAttribute("accept", "application/pdf");
|
||||||
input.onchange = async(e) => {
|
input.onchange = async(e) => {
|
||||||
const files = e.target.files;
|
const files = e.target.files;
|
||||||
|
|
||||||
this.addPdfsFromFiles(files, nextSiblingElement);
|
this.addPdfsFromFiles(files, nextSiblingElement);
|
||||||
this.updateFilename(files ? files[0].name : "");
|
this.updateFilename(files ? files[0].name : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
input.click();
|
input.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
async addPdfsFromFiles(files, nextSiblingElement) {
|
async addPdfsFromFiles(files, nextSiblingElement) {
|
||||||
this.fileName = files[0].name;
|
this.fileName = files[0].name;
|
||||||
for (var i=0; i < files.length; i++) {
|
for (var i=0; i < files.length; i++) {
|
||||||
await this.addPdfFile(files[i], nextSiblingElement);
|
await this.addPdfFile(files[i], nextSiblingElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelectorAll(".enable-on-file").forEach(element => {
|
document.querySelectorAll(".enable-on-file").forEach(element => {
|
||||||
element.disabled = false;
|
element.disabled = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
rotateElement(element, deg) {
|
rotateElement(element, deg) {
|
||||||
var lastTransform = element.style.rotate;
|
var lastTransform = element.style.rotate;
|
||||||
if (!lastTransform) {
|
if (!lastTransform) {
|
||||||
lastTransform = "0";
|
lastTransform = "0";
|
||||||
}
|
}
|
||||||
const lastAngle = parseInt(lastTransform.replace(/[^\d-]/g, ''));
|
const lastAngle = parseInt(lastTransform.replace(/[^\d-]/g, ''));
|
||||||
const newAngle = lastAngle + deg;
|
const newAngle = lastAngle + deg;
|
||||||
|
|
||||||
element.style.rotate = newAngle + "deg";
|
element.style.rotate = newAngle + "deg";
|
||||||
}
|
}
|
||||||
|
|
||||||
async addPdfFile(file, nextSiblingElement) {
|
async addPdfFile(file, nextSiblingElement) {
|
||||||
const { renderer, pdfDocument } = await this.loadFile(file);
|
const { renderer, pdfDocument } = await this.loadFile(file);
|
||||||
|
|
||||||
for (var i=0; i < renderer.pageCount; i++) {
|
for (var i=0; i < renderer.pageCount; i++) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
|
|
||||||
div.classList.add("page-container");
|
div.classList.add("page-container");
|
||||||
|
|
||||||
var img = document.createElement('img');
|
var img = document.createElement('img');
|
||||||
img.classList.add('page-image')
|
img.classList.add('page-image')
|
||||||
const imageSrc = await renderer.renderPage(i)
|
const imageSrc = await renderer.renderPage(i)
|
||||||
img.src = imageSrc;
|
img.src = imageSrc;
|
||||||
img.pageIdx = i;
|
img.pageIdx = i;
|
||||||
img.rend = renderer;
|
img.rend = renderer;
|
||||||
img.doc = pdfDocument;
|
img.doc = pdfDocument;
|
||||||
div.appendChild(img);
|
div.appendChild(img);
|
||||||
|
|
||||||
this.pdfAdapters.forEach((adapter) => {
|
this.pdfAdapters.forEach((adapter) => {
|
||||||
adapter.adapt?.(div)
|
adapter.adapt?.(div)
|
||||||
})
|
})
|
||||||
if (nextSiblingElement) {
|
if (nextSiblingElement) {
|
||||||
this.pagesContainer.insertBefore(div, nextSiblingElement);
|
this.pagesContainer.insertBefore(div, nextSiblingElement);
|
||||||
} else {
|
} else {
|
||||||
this.pagesContainer.appendChild(div);
|
this.pagesContainer.appendChild(div);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadFile(file) {
|
async loadFile(file) {
|
||||||
var objectUrl = URL.createObjectURL(file);
|
var objectUrl = URL.createObjectURL(file);
|
||||||
var pdfDocument = await this.toPdfLib(objectUrl);
|
var pdfDocument = await this.toPdfLib(objectUrl);
|
||||||
var renderer = await this.toRenderer(objectUrl);
|
var renderer = await this.toRenderer(objectUrl);
|
||||||
return { renderer, pdfDocument };
|
return { renderer, pdfDocument };
|
||||||
}
|
}
|
||||||
|
|
||||||
async toRenderer(objectUrl) {
|
async toRenderer(objectUrl) {
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs/pdf.worker.js'
|
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs/pdf.worker.js'
|
||||||
const pdf = await pdfjsLib.getDocument(objectUrl).promise;
|
const pdf = await pdfjsLib.getDocument(objectUrl).promise;
|
||||||
return {
|
return {
|
||||||
document: pdf,
|
document: pdf,
|
||||||
pageCount: pdf.numPages,
|
pageCount: pdf.numPages,
|
||||||
renderPage: async function(pageIdx) {
|
renderPage: async function(pageIdx) {
|
||||||
const page = await this.document.getPage(pageIdx+1);
|
const page = await this.document.getPage(pageIdx+1);
|
||||||
|
|
||||||
const canvas = document.createElement("canvas");
|
const canvas = document.createElement("canvas");
|
||||||
|
|
||||||
// set the canvas size to the size of the page
|
// set the canvas size to the size of the page
|
||||||
if (page.rotate == 90 || page.rotate == 270) {
|
if (page.rotate == 90 || page.rotate == 270) {
|
||||||
canvas.width = page.view[3];
|
canvas.width = page.view[3];
|
||||||
canvas.height = page.view[2];
|
canvas.height = page.view[2];
|
||||||
} else {
|
} else {
|
||||||
canvas.width = page.view[2];
|
canvas.width = page.view[2];
|
||||||
canvas.height = page.view[3];
|
canvas.height = page.view[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
// render the page onto the canvas
|
// render the page onto the canvas
|
||||||
var renderContext = {
|
var renderContext = {
|
||||||
canvasContext: canvas.getContext("2d"),
|
canvasContext: canvas.getContext("2d"),
|
||||||
viewport: page.getViewport({ scale: 1 })
|
viewport: page.getViewport({ scale: 1 })
|
||||||
};
|
};
|
||||||
|
|
||||||
await page.render(renderContext).promise;
|
await page.render(renderContext).promise;
|
||||||
return canvas.toDataURL();
|
return canvas.toDataURL();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async toPdfLib(objectUrl) {
|
async toPdfLib(objectUrl) {
|
||||||
const existingPdfBytes = await fetch(objectUrl).then(res => res.arrayBuffer());
|
const existingPdfBytes = await fetch(objectUrl).then(res => res.arrayBuffer());
|
||||||
const pdfDoc = await PDFLib.PDFDocument.load(existingPdfBytes, { ignoreEncryption: true });
|
const pdfDoc = await PDFLib.PDFDocument.load(existingPdfBytes, { ignoreEncryption: true });
|
||||||
return pdfDoc;
|
return pdfDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rotateAll(deg) {
|
rotateAll(deg) {
|
||||||
for (var i=0; i<this.pagesContainer.childNodes.length; i++) {
|
for (var i=0; i<this.pagesContainer.childNodes.length; i++) {
|
||||||
const img = this.pagesContainer.childNodes[i].querySelector("img");
|
const img = this.pagesContainer.childNodes[i].querySelector("img");
|
||||||
if (!img) continue;
|
if (!img) continue;
|
||||||
this.rotateElement(img, deg)
|
this.rotateElement(img, deg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async exportPdf() {
|
async exportPdf() {
|
||||||
const pdfDoc = await PDFLib.PDFDocument.create();
|
const pdfDoc = await PDFLib.PDFDocument.create();
|
||||||
const pageContainers = this.pagesContainer.querySelectorAll('.page-container'); // Select all .page-container elements
|
const pageContainers = this.pagesContainer.querySelectorAll('.page-container'); // Select all .page-container elements
|
||||||
for (var i = 0; i < pageContainers.length; i++) {
|
for (var i = 0; i < pageContainers.length; i++) {
|
||||||
const img = pageContainers[i].querySelector("img"); // Find the img element within each .page-container
|
const img = pageContainers[i].querySelector("img"); // Find the img element within each .page-container
|
||||||
if (!img) continue;
|
if (!img) continue;
|
||||||
const pages = await pdfDoc.copyPages(img.doc, [img.pageIdx])
|
const pages = await pdfDoc.copyPages(img.doc, [img.pageIdx])
|
||||||
const page = pages[0];
|
const page = pages[0];
|
||||||
|
|
||||||
const rotation = img.style.rotate;
|
const rotation = img.style.rotate;
|
||||||
if (rotation) {
|
if (rotation) {
|
||||||
const rotationAngle = parseInt(rotation.replace(/[^\d-]/g, ''));
|
const rotationAngle = parseInt(rotation.replace(/[^\d-]/g, ''));
|
||||||
page.setRotation(PDFLib.degrees(page.getRotation().angle + rotationAngle))
|
page.setRotation(PDFLib.degrees(page.getRotation().angle + rotationAngle))
|
||||||
}
|
}
|
||||||
|
|
||||||
pdfDoc.addPage(page);
|
pdfDoc.addPage(page);
|
||||||
}
|
}
|
||||||
const pdfBytes = await pdfDoc.save();
|
const pdfBytes = await pdfDoc.save();
|
||||||
const pdfBlob = new Blob([pdfBytes], { type: 'application/pdf' });
|
const pdfBlob = new Blob([pdfBytes], { type: 'application/pdf' });
|
||||||
const url = URL.createObjectURL(pdfBlob);
|
const url = URL.createObjectURL(pdfBlob);
|
||||||
const downloadOption = localStorage.getItem('downloadOption');
|
const downloadOption = localStorage.getItem('downloadOption');
|
||||||
|
|
||||||
const filenameInput = document.getElementById('filename-input');
|
const filenameInput = document.getElementById('filename-input');
|
||||||
|
|
||||||
let inputArr = filenameInput.value.split('.');
|
let inputArr = filenameInput.value.split('.');
|
||||||
|
|
||||||
if (inputArr !== null && inputArr !== undefined && inputArr.length > 0) {
|
if (inputArr !== null && inputArr !== undefined && inputArr.length > 0) {
|
||||||
|
|
||||||
inputArr = inputArr.filter(n => n); // remove all empty strings, nulls or undefined
|
inputArr = inputArr.filter(n => n); // remove all empty strings, nulls or undefined
|
||||||
|
|
||||||
if (inputArr.length > 1) {
|
if (inputArr.length > 1) {
|
||||||
inputArr.pop(); // remove right part after last dot
|
inputArr.pop(); // remove right part after last dot
|
||||||
}
|
}
|
||||||
|
|
||||||
filenameInput.value = inputArr.join('');
|
filenameInput.value = inputArr.join('');
|
||||||
this.fileName = filenameInput.value;
|
this.fileName = filenameInput.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filenameInput.value.includes('.pdf')) {
|
if (!filenameInput.value.includes('.pdf')) {
|
||||||
filenameInput.value = filenameInput.value + '.pdf';
|
filenameInput.value = filenameInput.value + '.pdf';
|
||||||
this.fileName = filenameInput.value;
|
this.fileName = filenameInput.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (downloadOption === 'sameWindow') {
|
if (downloadOption === 'sameWindow') {
|
||||||
// Open the file in the same window
|
// Open the file in the same window
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
} else if (downloadOption === 'newWindow') {
|
} else if (downloadOption === 'newWindow') {
|
||||||
// Open the file in a new window
|
// Open the file in a new window
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
} else {
|
} else {
|
||||||
// Download the file
|
// Download the file
|
||||||
this.downloadLink = document.createElement('a');
|
this.downloadLink = document.createElement('a');
|
||||||
this.downloadLink.id = 'download-link';
|
this.downloadLink.id = 'download-link';
|
||||||
this.downloadLink.href = url;
|
this.downloadLink.href = url;
|
||||||
// downloadLink.download = this.fileName ? this.fileName : 'managed.pdf';
|
// downloadLink.download = this.fileName ? this.fileName : 'managed.pdf';
|
||||||
// downloadLink.download = this.fileName;
|
// downloadLink.download = this.fileName;
|
||||||
this.downloadLink.setAttribute('download', this.fileName ? this.fileName : 'managed.pdf');
|
this.downloadLink.setAttribute('download', this.fileName ? this.fileName : 'managed.pdf');
|
||||||
this.downloadLink.setAttribute('target', '_blank');
|
this.downloadLink.setAttribute('target', '_blank');
|
||||||
this.downloadLink.onclick = this.setDownloadAttribute;
|
this.downloadLink.onclick = this.setDownloadAttribute;
|
||||||
this.downloadLink.click();
|
this.downloadLink.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setDownloadAttribute() {
|
setDownloadAttribute() {
|
||||||
this.downloadLink.setAttribute("download", this.fileName ? this.fileName : 'managed.pdf');
|
this.downloadLink.setAttribute("download", this.fileName ? this.fileName : 'managed.pdf');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFilename(fileName = "") {
|
updateFilename(fileName = "") {
|
||||||
const filenameInput = document.getElementById('filename-input');
|
const filenameInput = document.getElementById('filename-input');
|
||||||
const pagesContainer = document.getElementById('pages-container');
|
const pagesContainer = document.getElementById('pages-container');
|
||||||
const downloadBtn = document.getElementById('export-button');
|
const downloadBtn = document.getElementById('export-button');
|
||||||
|
|
||||||
downloadBtn.disabled = pagesContainer.childElementCount === 0
|
downloadBtn.disabled = pagesContainer.childElementCount === 0
|
||||||
|
|
||||||
if (!this.fileName) {
|
if (!this.fileName) {
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filenameInput.value) {
|
if (!filenameInput.value) {
|
||||||
filenameInput.value = this.fileName;
|
filenameInput.value = this.fileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preventIllegalChars(e) {
|
preventIllegalChars(e) {
|
||||||
// const filenameInput = document.getElementById('filename-input');
|
// const filenameInput = document.getElementById('filename-input');
|
||||||
//
|
//
|
||||||
// filenameInput.value = filenameInput.value.replace('.pdf', '');
|
// filenameInput.value = filenameInput.value.replace('.pdf', '');
|
||||||
//
|
//
|
||||||
// // prevent .
|
// // prevent .
|
||||||
// if (filenameInput.value.includes('.')) {
|
// if (filenameInput.value.includes('.')) {
|
||||||
// filenameInput.value.replace('.','');
|
// filenameInput.value.replace('.','');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PdfContainer;
|
export default PdfContainer;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,75 +1,75 @@
|
|||||||
// Toggle search bar when the search icon is clicked
|
// Toggle search bar when the search icon is clicked
|
||||||
document.querySelector('#search-icon').addEventListener('click', function(e) {
|
document.querySelector('#search-icon').addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var searchBar = document.querySelector('#navbarSearch');
|
var searchBar = document.querySelector('#navbarSearch');
|
||||||
searchBar.classList.toggle('show');
|
searchBar.classList.toggle('show');
|
||||||
});
|
});
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var items = document.querySelectorAll('.dropdown-item, .nav-link');
|
var items = document.querySelectorAll('.dropdown-item, .nav-link');
|
||||||
var dummyContainer = document.createElement('div');
|
var dummyContainer = document.createElement('div');
|
||||||
dummyContainer.style.position = 'absolute';
|
dummyContainer.style.position = 'absolute';
|
||||||
dummyContainer.style.visibility = 'hidden';
|
dummyContainer.style.visibility = 'hidden';
|
||||||
dummyContainer.style.whiteSpace = 'nowrap'; // Ensure we measure full width
|
dummyContainer.style.whiteSpace = 'nowrap'; // Ensure we measure full width
|
||||||
document.body.appendChild(dummyContainer);
|
document.body.appendChild(dummyContainer);
|
||||||
|
|
||||||
var maxWidth = 0;
|
var maxWidth = 0;
|
||||||
|
|
||||||
items.forEach(function(item) {
|
items.forEach(function(item) {
|
||||||
var clone = item.cloneNode(true);
|
var clone = item.cloneNode(true);
|
||||||
dummyContainer.appendChild(clone);
|
dummyContainer.appendChild(clone);
|
||||||
var width = clone.offsetWidth;
|
var width = clone.offsetWidth;
|
||||||
if (width > maxWidth) {
|
if (width > maxWidth) {
|
||||||
maxWidth = width;
|
maxWidth = width;
|
||||||
}
|
}
|
||||||
dummyContainer.removeChild(clone);
|
dummyContainer.removeChild(clone);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.body.removeChild(dummyContainer);
|
document.body.removeChild(dummyContainer);
|
||||||
|
|
||||||
// Store max width for later use
|
// Store max width for later use
|
||||||
window.navItemMaxWidth = maxWidth;
|
window.navItemMaxWidth = maxWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Show search results as user types in search box
|
// Show search results as user types in search box
|
||||||
document.querySelector('#navbarSearchInput').addEventListener('input', function(e) {
|
document.querySelector('#navbarSearchInput').addEventListener('input', function(e) {
|
||||||
var searchText = e.target.value.toLowerCase();
|
var searchText = e.target.value.toLowerCase();
|
||||||
var items = document.querySelectorAll('.dropdown-item, .nav-link');
|
var items = document.querySelectorAll('.dropdown-item, .nav-link');
|
||||||
var resultsBox = document.querySelector('#searchResults');
|
var resultsBox = document.querySelector('#searchResults');
|
||||||
|
|
||||||
// Clear any previous results
|
// Clear any previous results
|
||||||
resultsBox.innerHTML = '';
|
resultsBox.innerHTML = '';
|
||||||
|
|
||||||
items.forEach(function(item) {
|
items.forEach(function(item) {
|
||||||
var titleElement = item.querySelector('.icon-text');
|
var titleElement = item.querySelector('.icon-text');
|
||||||
var iconElement = item.querySelector('.icon');
|
var iconElement = item.querySelector('.icon');
|
||||||
var itemHref = item.getAttribute('href');
|
var itemHref = item.getAttribute('href');
|
||||||
var tags = item.getAttribute('data-bs-tags') || ""; // If no tags, default to empty string
|
var tags = item.getAttribute('data-bs-tags') || ""; // If no tags, default to empty string
|
||||||
|
|
||||||
if (titleElement && iconElement && itemHref !== '#') {
|
if (titleElement && iconElement && itemHref !== '#') {
|
||||||
var title = titleElement.innerText;
|
var title = titleElement.innerText;
|
||||||
if ((title.toLowerCase().indexOf(searchText) !== -1 || tags.toLowerCase().indexOf(searchText) !== -1) && !resultsBox.querySelector(`a[href="${item.getAttribute('href')}"]`)) {
|
if ((title.toLowerCase().indexOf(searchText) !== -1 || tags.toLowerCase().indexOf(searchText) !== -1) && !resultsBox.querySelector(`a[href="${item.getAttribute('href')}"]`)) {
|
||||||
var result = document.createElement('a');
|
var result = document.createElement('a');
|
||||||
result.href = itemHref;
|
result.href = itemHref;
|
||||||
result.classList.add('dropdown-item');
|
result.classList.add('dropdown-item');
|
||||||
|
|
||||||
var resultIcon = document.createElement('img');
|
var resultIcon = document.createElement('img');
|
||||||
resultIcon.src = iconElement.src;
|
resultIcon.src = iconElement.src;
|
||||||
resultIcon.alt = 'icon';
|
resultIcon.alt = 'icon';
|
||||||
resultIcon.classList.add('icon');
|
resultIcon.classList.add('icon');
|
||||||
result.appendChild(resultIcon);
|
result.appendChild(resultIcon);
|
||||||
|
|
||||||
var resultText = document.createElement('span');
|
var resultText = document.createElement('span');
|
||||||
resultText.textContent = title;
|
resultText.textContent = title;
|
||||||
resultText.classList.add('icon-text');
|
resultText.classList.add('icon-text');
|
||||||
result.appendChild(resultText);
|
result.appendChild(resultText);
|
||||||
|
|
||||||
resultsBox.appendChild(result);
|
resultsBox.appendChild(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set the width of the search results box to the maximum width
|
// Set the width of the search results box to the maximum width
|
||||||
resultsBox.style.width = window.navItemMaxWidth + 'px';
|
resultsBox.style.width = window.navItemMaxWidth + 'px';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<div th:fragment="card" class="feature-card" th:id="${id}" th:if="${@endpointConfiguration.isEndpointEnabled(cardLink)}" data-bs-tags="${tags}">
|
<div th:fragment="card" class="feature-card" th:id="${id}" th:if="${@endpointConfiguration.isEndpointEnabled(cardLink)}" data-bs-tags="${tags}">
|
||||||
<a th:href="${cardLink}">
|
<a th:href="${cardLink}">
|
||||||
<div class="d-flex align-items-center"> <!-- Add a flex container to align the SVG and title -->
|
<div class="d-flex align-items-center"> <!-- Add a flex container to align the SVG and title -->
|
||||||
<img th:if="${svgPath}" id="card-icon" class="home-card-icon home-card-icon-colour" th:src="${svgPath}" alt="Icon" width="30" height="30">
|
<img th:if="${svgPath}" id="card-icon" class="home-card-icon home-card-icon-colour" th:src="${svgPath}" alt="Icon" width="30" height="30">
|
||||||
<h5 class="card-title ms-2" th:text="${cardTitle}"></h5> <!-- Add some margin-left (ms-2) for spacing between SVG and title -->
|
<h5 class="card-title ms-2" th:text="${cardTitle}"></h5> <!-- Add some margin-left (ms-2) for spacing between SVG and title -->
|
||||||
</div>
|
</div>
|
||||||
<p class="card-text" th:text="${cardText}"></p>
|
<p class="card-text" th:text="${cardText}"></p>
|
||||||
</a>
|
</a>
|
||||||
<div class="favorite-icon" onclick="toggleFavorite(this)">
|
<div class="favorite-icon" onclick="toggleFavorite(this)">
|
||||||
<img src="images/star.svg" alt="Favorite">
|
<img src="images/star.svg" alt="Favorite">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
<div th:fragment="footer">
|
<div th:fragment="footer">
|
||||||
<footer id="footer" class="text-center py-3">
|
<footer id="footer" class="text-center py-3">
|
||||||
<div class="footer-center">
|
<div class="footer-center">
|
||||||
|
|
||||||
<a href="https://github.com/Stirling-Tools/Stirling-PDF"
|
<a href="https://github.com/Stirling-Tools/Stirling-PDF"
|
||||||
target="_blank" class="mx-1" title="Visit Github Repository"><img
|
target="_blank" class="mx-1" title="Visit Github Repository"><img
|
||||||
src="images/github.svg"></img></a> <a
|
src="images/github.svg"></img></a> <a
|
||||||
href="https://hub.docker.com/r/frooodle/s-pdf" target="_blank"
|
href="https://hub.docker.com/r/frooodle/s-pdf" target="_blank"
|
||||||
class="mx-1" title="See Docker Hub"><img src="images/docker.svg"></img></a>
|
class="mx-1" title="See Docker Hub"><img src="images/docker.svg"></img></a>
|
||||||
<a href="https://discord.gg/Cn8pWhQRxZ" target="_blank" class="mx-1"
|
<a href="https://discord.gg/Cn8pWhQRxZ" target="_blank" class="mx-1"
|
||||||
title="Join Discord Channel"><img src="images/discord.svg"></img></a>
|
title="Join Discord Channel"><img src="images/discord.svg"></img></a>
|
||||||
<a href="https://github.com/sponsors/Frooodle" target="_blank"
|
<a href="https://github.com/sponsors/Frooodle" target="_blank"
|
||||||
class="mx-1" title="Donate"><img
|
class="mx-1" title="Donate"><img
|
||||||
src="images/suit-heart-fill.svg"></img></a>
|
src="images/suit-heart-fill.svg"></img></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div style="color: grey;" th:if="${@appName} != 'Stirling PDF'" class="footer-powered-by" th:text="#{poweredBy} + ' Stirling PDF'"></div>
|
<div style="color: grey;" th:if="${@appName} != 'Stirling PDF'" class="footer-powered-by" th:text="#{poweredBy} + ' Stirling PDF'"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<a href="licenses" id="licenses" target="_blank" class="mx-1" title="" th:text="#{licenses.nav}">Licenses</a>
|
<a href="licenses" id="licenses" target="_blank" class="mx-1" title="" th:text="#{licenses.nav}">Licenses</a>
|
||||||
|
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column; /* Stack children vertically */
|
flex-direction: column; /* Stack children vertically */
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-center {
|
.footer-center {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column; /* Stack items vertically */
|
flex-direction: column; /* Stack items vertically */
|
||||||
justify-content: center; /* Center children vertically */
|
justify-content: center; /* Center children vertically */
|
||||||
align-items: center; /* Center children horizontally */
|
align-items: center; /* Center children horizontally */
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-powered-by {
|
.footer-powered-by {
|
||||||
margin-top: auto; /* Pushes the text to the bottom */
|
margin-top: auto; /* Pushes the text to the bottom */
|
||||||
color: grey;
|
color: grey;
|
||||||
text-align: center; /* Centers the text inside the div */
|
text-align: center; /* Centers the text inside the div */
|
||||||
width: 100%; /* Full width to center the text properly */
|
width: 100%; /* Full width to center the text properly */
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-link-container {
|
.right-link-container {
|
||||||
align-self: flex-end; /* Align to the end of the flex container */
|
align-self: flex-end; /* Align to the end of the flex container */
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user