Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2a65dc360 | ||
|
|
7b4a889ea7 | ||
|
|
f627d251c3 | ||
|
|
d5b7125415 | ||
|
|
67dd3cf0e3 | ||
|
|
b8b62bb5af | ||
|
|
b4a9d1ac18 | ||
|
|
8aae651c2c | ||
|
|
fc9465b324 | ||
|
|
579a50be2c | ||
|
|
9c5b967e4c | ||
|
|
d41deb729b | ||
|
|
a93a89f3f0 | ||
|
|
11d642a25f | ||
|
|
67448498ea | ||
|
|
489b8da713 |
84
.github/workflows/push-docker.yml
vendored
84
.github/workflows/push-docker.yml
vendored
@@ -9,13 +9,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
push:
|
push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
config: [
|
|
||||||
{ dockerfile: "./Dockerfile", tagSuffix: "" },
|
|
||||||
{ dockerfile: "./Dockerfile-ultra-lite", tagSuffix: "-ultra-lite" },
|
|
||||||
{ dockerfile: "./Dockerfile-lite", tagSuffix: "-lite" }
|
|
||||||
]
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v3.5.2
|
- uses: actions/checkout@v3.5.2
|
||||||
@@ -56,14 +49,6 @@ jobs:
|
|||||||
id: repoowner
|
id: repoowner
|
||||||
run: echo "::set-output name=lowercase::$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}')"
|
run: echo "::set-output name=lowercase::$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}')"
|
||||||
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
|
||||||
|
|
||||||
|
|
||||||
- name: Generate tags
|
- name: Generate tags
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4.4.0
|
uses: docker/metadata-action@v4.4.0
|
||||||
@@ -72,19 +57,76 @@ jobs:
|
|||||||
${{ secrets.DOCKER_HUB_USERNAME }}/s-pdf
|
${{ secrets.DOCKER_HUB_USERNAME }}/s-pdf
|
||||||
ghcr.io/${{ steps.repoowner.outputs.lowercase }}/s-pdf
|
ghcr.io/${{ steps.repoowner.outputs.lowercase }}/s-pdf
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ steps.versionNumber.outputs.versionNumber }}${{ matrix.config.tagSuffix }},enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=${{ steps.versionNumber.outputs.versionNumber }},enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
type=raw,value=latest${{ matrix.config.tagSuffix }},enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
type=raw,value=alpha,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=alpha,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
- name: Build and push Dockerfile
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2.1.0
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2.5.0
|
||||||
|
|
||||||
|
- name: Build and push main Dockerfile
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.0.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ${{ matrix.config.dockerfile }}
|
dockerfile: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64,linux/arm64/v8
|
platforms: linux/amd64,linux/arm64/v8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Generate tags ultra-lite
|
||||||
|
id: meta2
|
||||||
|
uses: docker/metadata-action@v4.4.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ secrets.DOCKER_HUB_USERNAME }}/s-pdf
|
||||||
|
ghcr.io/${{ steps.repoowner.outputs.lowercase }}/s-pdf
|
||||||
|
tags: |
|
||||||
|
type=raw,value=${{ steps.versionNumber.outputs.versionNumber }}-ultra-lite,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
|
type=raw,value=latest-ultra-lite,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build and push Dockerfile-ultra-lite
|
||||||
|
uses: docker/build-push-action@v4.0.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile-ultra-lite
|
||||||
|
push: true
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
tags: ${{ steps.meta2.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta2.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64/v8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- name: Generate tags lite
|
||||||
|
id: meta3
|
||||||
|
uses: docker/metadata-action@v4.4.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ secrets.DOCKER_HUB_USERNAME }}/s-pdf
|
||||||
|
ghcr.io/${{ steps.repoowner.outputs.lowercase }}/s-pdf
|
||||||
|
tags: |
|
||||||
|
type=raw,value=${{ steps.versionNumber.outputs.versionNumber }}-lite,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
|
type=raw,value=latest-lite,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build and push Dockerfile-lite
|
||||||
|
uses: docker/build-push-action@v4.0.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile-lite
|
||||||
|
push: true
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
tags: ${{ steps.meta3.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta3.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64/v8
|
||||||
45
.github/workflows/releaseArtifacts.yml
vendored
Normal file
45
.github/workflows/releaseArtifacts.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Release Artifacts
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
jobs:
|
||||||
|
push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3.5.2
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v3.11.0
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Generate jar
|
||||||
|
run: ./gradlew clean createExe
|
||||||
|
|
||||||
|
- name: Upload binaries to release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ./build/launch4j/Stirling-PDF.exe
|
||||||
|
asset_name: Stirling-PDF.exe
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
|
- name: Get version number
|
||||||
|
id: versionNumber
|
||||||
|
run: echo "::set-output name=versionNumber::$(./gradlew printVersion --quiet | tail -1)"
|
||||||
|
|
||||||
|
- name: Upload binaries to release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ./build/libs/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.jar
|
||||||
|
asset_name: S-PDF.jar
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ COPY build/libs/*.jar app.jar
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV GROUPS_TO_REMOVE=LibreOffice,CLI
|
ENV GROUPS_TO_REMOVE=CLI
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
CMD ["java", "-jar", "/app.jar"]
|
CMD ["java", "-jar", "/app.jar"]
|
||||||
|
|||||||
35
Endpoint-groups.md
Normal file
35
Endpoint-groups.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
| Operation | PageOps | Convert | Security | Other | CLI | Python | OpenCV | LibreOffice | OCRmyPDF | Java | Javascript |
|
||||||
|
|---------------------|---------|---------|----------|-------|------|--------|--------|-------------|----------|----------|------------|
|
||||||
|
| merge-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| multi-page-layout | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| pdf-organizer | ✔️ | | | | | | | | | ✔️ | ✔️ |
|
||||||
|
| remove-pages | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| rotate-pdf | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| scale-pages | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| split-pdfs | ✔️ | | | | | | | | | ✔️ | |
|
||||||
|
| file-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| img-to-pdf | | ✔️ | | | | | | | | ✔️ | |
|
||||||
|
| pdf-to-html | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| pdf-to-img | | ✔️ | | | | | | | | ✔️ | |
|
||||||
|
| pdf-to-pdfa | | ✔️ | | | ✔️ | | | | ✔️ | | |
|
||||||
|
| pdf-to-presentation | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| pdf-to-text | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| pdf-to-word | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| pdf-to-xml | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| xlsx-to-pdf | | ✔️ | | | ✔️ | | | ✔️ | | | |
|
||||||
|
| add-password | | | ✔️ | | | | | | | ✔️ | |
|
||||||
|
| add-watermark | | | ✔️ | | | | | | | ✔️ | |
|
||||||
|
| cert-sign | | | ✔️ | | | | | | | ✔️ | |
|
||||||
|
| change-permissions | | | ✔️ | | | | | | | ✔️ | |
|
||||||
|
| remove-password | | | ✔️ | | | | | | | ✔️ | |
|
||||||
|
| add-image | | | | ✔️ | | | | | | ✔️ | |
|
||||||
|
| change-metadata | | | | ✔️ | | | | | | ✔️ | |
|
||||||
|
| compare | | | | ✔️ | | | | | | | ✔️ |
|
||||||
|
| compress-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
||||||
|
| extract-image-scans | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
||||||
|
| extract-images | | | | ✔️ | | | | | | ✔️ | |
|
||||||
|
| flatten | | | | ✔️ | | | | | | | |
|
||||||
|
| ocr-pdf | | | | ✔️ | ✔️ | | | | ✔️ | | |
|
||||||
|
| remove-blanks | | | | ✔️ | ✔️ | ✔️ | ✔️ | | | | |
|
||||||
|
| repair | | | | ✔️ | ✔️ | | | ✔️ | | | |
|
||||||
|
| sign | | | | ✔️ | | | | | | | ✔️ |
|
||||||
@@ -123,7 +123,7 @@ This folder is required for the python scripts using OpenCV
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo mkdir /opt/Stirling-PDF &&\
|
sudo mkdir /opt/Stirling-PDF &&\
|
||||||
sudo mv ./build/libs/S-PDF-*.jar /opt/Stirling-PDF/ &&\
|
sudo mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/ &&\
|
||||||
sudo mv scripts /opt/Stirling-PDF/ &&\
|
sudo mv scripts /opt/Stirling-PDF/ &&\
|
||||||
echo "Scripts installed."
|
echo "Scripts installed."
|
||||||
```
|
```
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -53,6 +53,7 @@ Hosted instance/demo of the app can be seen [here](https://pdf.adminforge.de/) h
|
|||||||
## Technologies used
|
## Technologies used
|
||||||
- Spring Boot + Thymeleaf
|
- Spring Boot + Thymeleaf
|
||||||
- PDFBox
|
- PDFBox
|
||||||
|
- IText7
|
||||||
- [LibreOffice](https://www.libreoffice.org/discover/libreoffice/) for advanced conversions
|
- [LibreOffice](https://www.libreoffice.org/discover/libreoffice/) for advanced conversions
|
||||||
- [OcrMyPdf](https://github.com/ocrmypdf/OCRmyPDF)
|
- [OcrMyPdf](https://github.com/ocrmypdf/OCRmyPDF)
|
||||||
- HTML, CSS, JavaScript
|
- HTML, CSS, JavaScript
|
||||||
@@ -68,13 +69,20 @@ Please view https://github.com/Frooodle/Stirling-PDF/blob/main/LocalRunGuide.md
|
|||||||
### Docker
|
### Docker
|
||||||
https://hub.docker.com/r/frooodle/s-pdf
|
https://hub.docker.com/r/frooodle/s-pdf
|
||||||
|
|
||||||
|
Stirling PDF has 3 different versions, a Full version, Lite and ultra-Lite. Depending on the types of features you use you may want a smaller image to save on space.
|
||||||
|
To see what the different versions offer please look at our [version mapping](https://github.com/Frooodle/Stirling-PDF/blob/main/Version-groups.md)
|
||||||
|
For people that dont mind about space optimisation just use latest tag.
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
Docker Run
|
Docker Run
|
||||||
```
|
```
|
||||||
docker run -d \
|
docker run -d \
|
||||||
-p 8080:8080 \
|
-p 8080:8080 \
|
||||||
-v /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata \
|
-v /location/of/trainingData:/usr/share/tesseract-ocr/4.00/tessdata \
|
||||||
--name stirling-pdf \
|
--name stirling-pdf \
|
||||||
frooodle/s-pdf
|
frooodle/s-pdf:latest
|
||||||
|
|
||||||
|
|
||||||
Can also add these for customisation but are not required
|
Can also add these for customisation but are not required
|
||||||
@@ -90,7 +98,7 @@ Docker Compose
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
stirling-pdf:
|
stirling-pdf:
|
||||||
image: frooodle/s-pdf
|
image: frooodle/s-pdf:latest
|
||||||
ports:
|
ports:
|
||||||
- '8080:8080'
|
- '8080:8080'
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
48
Version-groups.md
Normal file
48
Version-groups.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
|Technology | Ultra-Lite | Lite | Full |
|
||||||
|
|----------------|:----------:|:----:|:----:|
|
||||||
|
| Java | ✔️ | ✔️ | ✔️ |
|
||||||
|
| JavaScript | ✔️ | ✔️ | ✔️ |
|
||||||
|
| Libre | | ✔️ | ✔️ |
|
||||||
|
| Python | | | ✔️ |
|
||||||
|
| OpenCV | | | ✔️ |
|
||||||
|
| OCRmyPDF | | | ✔️ |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Operation | Ultra-Lite | Lite | Full
|
||||||
|
--------------------|------------|------|-----
|
||||||
|
add-password | ✔️ | ✔️ | ✔️
|
||||||
|
add-watermark | ✔️ | ✔️ | ✔️
|
||||||
|
cert-sign | ✔️ | ✔️ | ✔️
|
||||||
|
change-metadata | ✔️ | ✔️ | ✔️
|
||||||
|
change-permissions | ✔️ | ✔️ | ✔️
|
||||||
|
compare | ✔️ | ✔️ | ✔️
|
||||||
|
extract-images | ✔️ | ✔️ | ✔️
|
||||||
|
flatten | ✔️ | ✔️ | ✔️
|
||||||
|
img-to-pdf | ✔️ | ✔️ | ✔️
|
||||||
|
merge-pdfs | ✔️ | ✔️ | ✔️
|
||||||
|
multi-page-layout | ✔️ | ✔️ | ✔️
|
||||||
|
pdf-organizer | ✔️ | ✔️ | ✔️
|
||||||
|
pdf-to-img | ✔️ | ✔️ | ✔️
|
||||||
|
remove-pages | ✔️ | ✔️ | ✔️
|
||||||
|
remove-password | ✔️ | ✔️ | ✔️
|
||||||
|
rotate-pdf | ✔️ | ✔️ | ✔️
|
||||||
|
scale-pages | ✔️ | ✔️ | ✔️
|
||||||
|
sign | ✔️ | ✔️ | ✔️
|
||||||
|
split-pdfs | ✔️ | ✔️ | ✔️
|
||||||
|
add-image | ✔️ | ✔️ | ✔️
|
||||||
|
file-to-pdf | | ✔️ | ✔️
|
||||||
|
pdf-to-html | | ✔️ | ✔️
|
||||||
|
pdf-to-presentation | | ✔️ | ✔️
|
||||||
|
pdf-to-text | | ✔️ | ✔️
|
||||||
|
pdf-to-word | | ✔️ | ✔️
|
||||||
|
pdf-to-xml | | ✔️ | ✔️
|
||||||
|
repair | | ✔️ | ✔️
|
||||||
|
xlsx-to-pdf | | ✔️ | ✔️
|
||||||
|
compress-pdf | | | ✔️
|
||||||
|
extract-image-scans | | | ✔️
|
||||||
|
ocr-pdf | | | ✔️
|
||||||
|
pdf-to-pdfa | | | ✔️
|
||||||
|
remove-blanks | | | ✔️
|
||||||
26
build.gradle
26
build.gradle
@@ -4,10 +4,11 @@ plugins {
|
|||||||
id 'io.spring.dependency-management' version '1.1.0'
|
id 'io.spring.dependency-management' version '1.1.0'
|
||||||
id 'org.springdoc.openapi-gradle-plugin' version '1.6.0'
|
id 'org.springdoc.openapi-gradle-plugin' version '1.6.0'
|
||||||
id "io.swagger.swaggerhub" version "1.1.0"
|
id "io.swagger.swaggerhub" version "1.1.0"
|
||||||
|
id 'edu.sc.seis.launch4j' version '3.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'stirling.software'
|
group = 'stirling.software'
|
||||||
version = '0.10.1'
|
version = '0.10.2'
|
||||||
sourceCompatibility = '17'
|
sourceCompatibility = '17'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -20,6 +21,29 @@ openApi {
|
|||||||
outputFileName = "SwaggerDoc.json"
|
outputFileName = "SwaggerDoc.json"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
launch4j {
|
||||||
|
icon = "${projectDir}/src/main/resources/static/favicon.ico"
|
||||||
|
|
||||||
|
outfile="Stirling-PDF.exe"
|
||||||
|
headerType="console"
|
||||||
|
jarTask = tasks.bootJar
|
||||||
|
|
||||||
|
errTitle="Encountered error, Do you have Java 17?"
|
||||||
|
downloadUrl="https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe"
|
||||||
|
variables=["BROWSER_OPEN=true"]
|
||||||
|
jreMinVersion="17"
|
||||||
|
|
||||||
|
mutexName="Stirling-PDF"
|
||||||
|
windowTitle="Stirling-PDF"
|
||||||
|
|
||||||
|
messagesStartupError="An error occurred while starting Stirling-PDF"
|
||||||
|
//messagesJreNotFoundError="This application requires a Java Runtime Environment, Please download Java 17."
|
||||||
|
messagesJreVersionError="You are running the wrong version of Java, Please download Java 17."
|
||||||
|
messagesLauncherError="Java is corrupted. Please uninstall and then install Java 17."
|
||||||
|
messagesInstanceAlreadyExists="Stirling-PDF is already running."
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web:3.1.0'
|
implementation 'org.springframework.boot:spring-boot-starter-web:3.1.0'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.1.0'
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.1.0'
|
||||||
|
|||||||
38
groups.md
38
groups.md
@@ -1,38 +0,0 @@
|
|||||||
Operation | PageOps | Convert | Security | Other | CLI | Python | OpenCV | LibreOffice | OCRmyPDF | Java | Javascript
|
|
||||||
--------------------|---------|---------|----------|-------|------|--------|--------|-------------|--------- |-------- |-----------
|
|
||||||
remove-pages | X | | | | | | | | | X |
|
|
||||||
merge-pdfs | X | | | | | | | | | X |
|
|
||||||
split-pdfs | X | | | | | | | | | X |
|
|
||||||
pdf-organizer | X | | | | | | | | | X | X
|
|
||||||
rotate-pdf | X | | | | | | | | | X |
|
|
||||||
multi-page-layout | X | | | | | | | | | X |
|
|
||||||
scale-pages | X | | | | | | | | | X |
|
|
||||||
pdf-to-img | | X | | | | | | | | X |
|
|
||||||
img-to-pdf | | X | | | | | | | | X |
|
|
||||||
pdf-to-pdfa | | X | | | X | | | | X | |
|
|
||||||
file-to-pdf | | X | | | X | | | X | | |
|
|
||||||
xlsx-to-pdf | | X | | | X | | | X | | |
|
|
||||||
pdf-to-word | | X | | | X | | | X | | |
|
|
||||||
pdf-to-presentation | | X | | | X | | | X | | |
|
|
||||||
pdf-to-text | | X | | | X | | | X | | |
|
|
||||||
pdf-to-html | | X | | | X | | | X | | |
|
|
||||||
pdf-to-xml | | X | | | X | | | X | | |
|
|
||||||
add-password | | | X | | | | | | | X |
|
|
||||||
remove-password | | | X | | | | | | | X |
|
|
||||||
change-permissions | | | X | | | | | | | X |
|
|
||||||
add-watermark | | | X | | | | | | | X |
|
|
||||||
cert-sign | | | X | | | | | | | X |
|
|
||||||
ocr-pdf | | | | X | X | | | | X | |
|
|
||||||
add-image | | | | X | | | | | | X |
|
|
||||||
compress-pdf | | | | X | X | | | | X
|
|
||||||
extract-images | | | | X | | | | | | X |
|
|
||||||
change-metadata | | | | X | | | | | | X |
|
|
||||||
extract-image-scans | | | | X | X | X | X | | | |
|
|
||||||
sign | | | | X | | | | | | | X
|
|
||||||
flatten | | | | X | | | | | | |
|
|
||||||
repair | | | | X | X | | | X | | |
|
|
||||||
remove-blanks | | | | X | X | X | X | | | |
|
|
||||||
compare | | | | X | | | | | | | X
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
36
lauch4jConfig.xml
Normal file
36
lauch4jConfig.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<launch4jConfig>
|
||||||
|
<dontWrapJar>false</dontWrapJar>
|
||||||
|
<headerType>console</headerType>
|
||||||
|
<jar>.\build\libs\S-PDF-0.10.1.jar</jar>
|
||||||
|
<outfile>.\Stirling-PDF.exe</outfile>
|
||||||
|
<errTitle>Please download Java17</errTitle>
|
||||||
|
<cmdLine></cmdLine>
|
||||||
|
<chdir>.</chdir>
|
||||||
|
<priority>normal</priority>
|
||||||
|
<downloadUrl>https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe</downloadUrl>
|
||||||
|
<supportUrl></supportUrl>
|
||||||
|
<stayAlive>false</stayAlive>
|
||||||
|
<restartOnCrash>false</restartOnCrash>
|
||||||
|
<manifest></manifest>
|
||||||
|
<icon>./src/main/resources/static/favicon.ico</icon>
|
||||||
|
<var>BROWSER_OPEN=true</var>
|
||||||
|
<singleInstance>
|
||||||
|
<mutexName>Stirling-PDF</mutexName>
|
||||||
|
<windowTitle>Stirling-PDF</windowTitle>
|
||||||
|
</singleInstance>
|
||||||
|
<jre>
|
||||||
|
<path>%JAVA_HOME%;%PATH%</path>
|
||||||
|
<requiresJdk>false</requiresJdk>
|
||||||
|
<requires64Bit>false</requires64Bit>
|
||||||
|
<minVersion>17</minVersion>
|
||||||
|
<maxVersion></maxVersion>
|
||||||
|
</jre>
|
||||||
|
<messages>
|
||||||
|
<startupErr>An error occurred while starting Stirling-PDF</startupErr>
|
||||||
|
<jreNotFoundErr>This application requires a Java Runtime Environment, Please download Java 17.</jreNotFoundErr>
|
||||||
|
<jreVersionErr>You are running the wrong version of Java, Please download Java 17.</jreVersionErr>
|
||||||
|
<launcherErr>Java is corrupted. Please uninstall and then install Java 17.</launcherErr>
|
||||||
|
<instanceAlreadyExistsMsg>Stirling-PDF is already running.</instanceAlreadyExistsMsg>
|
||||||
|
</messages>
|
||||||
|
</launch4jConfig>
|
||||||
@@ -1 +1 @@
|
|||||||
rootProject.name = 'S-PDF'
|
rootProject.name = 'Stirling-PDF'
|
||||||
|
|||||||
@@ -2,10 +2,63 @@ package stirling.software.SPDF;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class SPdfApplication {
|
public class SPdfApplication {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment env;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
// Check if the BROWSER_OPEN environment variable is set to true
|
||||||
|
String browserOpenEnv = env.getProperty("BROWSER_OPEN");
|
||||||
|
boolean browserOpen = browserOpenEnv != null && browserOpenEnv.equalsIgnoreCase("true");
|
||||||
|
|
||||||
|
if (browserOpen) {
|
||||||
|
try {
|
||||||
|
String port = env.getProperty("local.server.port");
|
||||||
|
if(port == null || port.length() == 0) {
|
||||||
|
port="8080";
|
||||||
|
}
|
||||||
|
String url = "http://localhost:" + port;
|
||||||
|
|
||||||
|
String os = System.getProperty("os.name").toLowerCase();
|
||||||
|
Runtime rt = Runtime.getRuntime();
|
||||||
|
if (os.contains("win")) {
|
||||||
|
// For Windows
|
||||||
|
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(SPdfApplication.class, args);
|
SpringApplication.run(SPdfApplication.class, args);
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
System.out.println("Stirling-PDF Started.");
|
||||||
|
|
||||||
|
String port = System.getProperty("local.server.port");
|
||||||
|
if(port == null || port.length() == 0) {
|
||||||
|
port="8080";
|
||||||
|
}
|
||||||
|
String url = "http://localhost:" + port;
|
||||||
|
System.out.println("Navigate to " + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
BIN
src/main/resources/static/favicon.ico
Normal file
BIN
src/main/resources/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 KiB |
@@ -17,7 +17,7 @@ $(document).ready(function() {
|
|||||||
const override = $('#override').val() || '';
|
const override = $('#override').val() || '';
|
||||||
const originalButtonText = $('#submitBtn').text();
|
const originalButtonText = $('#submitBtn').text();
|
||||||
$('#submitBtn').text('Processing...');
|
$('#submitBtn').text('Processing...');
|
||||||
|
console.log(override);
|
||||||
try {
|
try {
|
||||||
if(remoteCall === true) {
|
if(remoteCall === true) {
|
||||||
if (override === 'multi' || (!multiple && files.length > 1) && override !== 'single' ) {
|
if (override === 'multi' || (!multiple && files.length > 1) && override !== 'single' ) {
|
||||||
@@ -37,7 +37,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function handleSingleDownload(url, formData, isMulti = false) {
|
async function handleSingleDownload(url, formData, isMulti = false , isZip = false) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url, { method: 'POST', body: formData });
|
const response = await fetch(url, { method: 'POST', body: formData });
|
||||||
const contentType = response.headers.get('content-type');
|
const contentType = response.headers.get('content-type');
|
||||||
@@ -54,11 +54,10 @@ async function handleSingleDownload(url, formData, isMulti = false) {
|
|||||||
let filename = getFilenameFromContentDisposition(contentDisposition);
|
let filename = getFilenameFromContentDisposition(contentDisposition);
|
||||||
|
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
if (contentType.includes('application/pdf') || contentType.includes('image/')) {
|
if (contentType.includes('application/pdf') || contentType.includes('image/')) {
|
||||||
return handleResponse(blob, filename, !isMulti);
|
return handleResponse(blob, filename, !isMulti, isZip);
|
||||||
} else {
|
} else {
|
||||||
return handleResponse(blob, filename);
|
return handleResponse(blob, filename, false, isZip);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error in handleSingleDownload:', error);
|
console.error('Error in handleSingleDownload:', error);
|
||||||
@@ -95,7 +94,7 @@ async function handleJsonResponse(response) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function handleResponse(blob, filename, considerViewOptions = false) {
|
async function handleResponse(blob, filename, considerViewOptions = false, isZip = false) {
|
||||||
if (!blob) return;
|
if (!blob) return;
|
||||||
const downloadOption = localStorage.getItem('downloadOption');
|
const downloadOption = localStorage.getItem('downloadOption');
|
||||||
if (considerViewOptions) {
|
if (considerViewOptions) {
|
||||||
@@ -107,9 +106,11 @@ async function handleResponse(blob, filename, considerViewOptions = false) {
|
|||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(!isZip){
|
||||||
|
downloadFile(blob, filename);
|
||||||
}
|
}
|
||||||
downloadFile(blob, filename);
|
|
||||||
return { filename, blob };
|
return { filename, blob };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +126,6 @@ function downloadFile(blob, filename) {
|
|||||||
console.error('Invalid blob passed to downloadFile function');
|
console.error('Invalid blob passed to downloadFile function');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
@@ -176,12 +176,12 @@ async function submitMultiPdfForm(url, files) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloadDetails = await handleSingleDownload(url, fileFormData, true);
|
const downloadDetails = await handleSingleDownload(url, fileFormData, true, zipFiles);
|
||||||
console.log(downloadDetails);
|
console.log(downloadDetails);
|
||||||
if (zipFiles) {
|
if (zipFiles) {
|
||||||
jszip.file(downloadDetails.filename, downloadDetails.blob);
|
jszip.file(downloadDetails.filename, downloadDetails.blob);
|
||||||
} else {
|
} else {
|
||||||
downloadFile(downloadDetails.blob, downloadDetails.filename);
|
//downloadFile(downloadDetails.blob, downloadDetails.filename);
|
||||||
}
|
}
|
||||||
updateProgressBar(progressBar, Array.from(files).length);
|
updateProgressBar(progressBar, Array.from(files).length);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user