Skip to content

Commit 9951695

Browse files
Frooodlepixeebot[bot]ConnorYoh
authored
Python fix for new release (#3247)
# Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: a <a> Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> Co-authored-by: Connor Yoh <[email protected]>
1 parent 546749a commit 9951695

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
7373
py3-pillow@testing \
7474
py3-pdf2image@testing && \
7575
python3 -m venv /opt/venv && \
76-
pip install --upgrade pip && \
77-
pip install --no-cache-dir --upgrade unoserver weasyprint && \
76+
/opt/venv/bin/pip install --upgrade pip && \
77+
/opt/venv/bin/pip install --no-cache-dir --upgrade unoserver weasyprint && \
7878
ln -s /usr/lib/libreoffice/program/uno.py /opt/venv/lib/python3.12/site-packages/ && \
7979
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
8080
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \

Dockerfile.fat

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
8383
py3-pillow@testing \
8484
py3-pdf2image@testing && \
8585
python3 -m venv /opt/venv && \
86-
pip install --upgrade pip && \
87-
pip install --no-cache-dir --upgrade unoserver weasyprint && \
86+
/opt/venv/bin/pip install --upgrade pip && \
87+
/opt/venv/bin/pip install --no-cache-dir --upgrade unoserver weasyprint && \
8888
ln -s /usr/lib/libreoffice/program/uno.py /opt/venv/lib/python3.12/site-packages/ && \
8989
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
9090
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \

exampleYmlFiles/test_cicd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
stirling-pdf:
33
container_name: Stirling-PDF-Security-Fat-with-login
4-
image: stirlingtools/stirling-pdf:latest-fat
4+
image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest-fat
55
deploy:
66
resources:
77
limits:

src/main/java/stirling/software/SPDF/controller/api/MergeController.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ public ResponseEntity<byte[]> mergePdfs(@ModelAttribute MergePdfsRequest form)
147147
filesToDelete.add(tempFile); // Add temp file to the list for later deletion
148148
mergerUtility.addSource(tempFile); // Add source file to the merger utility
149149
}
150-
150+
151151
mergedTempFile = Files.createTempFile("merged-", ".pdf").toFile();
152152
mergerUtility.setDestinationFileName(mergedTempFile.getAbsolutePath());
153-
153+
154154
mergerUtility.mergeDocuments(
155155
pdfDocumentFactory.getStreamCacheFunction(totalSize)); // Merge the documents
156156

@@ -189,14 +189,14 @@ public ResponseEntity<byte[]> mergePdfs(@ModelAttribute MergePdfsRequest form)
189189
log.error("Error in merge pdf process", ex);
190190
throw ex;
191191
} finally {
192-
if (mergedDocument != null) {
192+
if (mergedDocument != null) {
193193
mergedDocument.close(); // Close the merged document
194194
}
195195
for (File file : filesToDelete) {
196196
if (file != null) {
197197
Files.deleteIfExists(file.toPath()); // Delete temporary files
198198
}
199-
}
199+
}
200200
if (mergedTempFile != null) {
201201
Files.deleteIfExists(mergedTempFile.toPath());
202202
}

0 commit comments

Comments
 (0)