File tree 4 files changed +9
-9
lines changed
src/main/java/stirling/software/SPDF/controller/api
4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
73
73
py3-pillow@testing \
74
74
py3-pdf2image@testing && \
75
75
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 && \
78
78
ln -s /usr/lib/libreoffice/program/uno.py /opt/venv/lib/python3.12/site-packages/ && \
79
79
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
80
80
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ RUN echo "@main https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee -a /etc/a
83
83
py3-pillow@testing \
84
84
py3-pdf2image@testing && \
85
85
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 && \
88
88
ln -s /usr/lib/libreoffice/program/uno.py /opt/venv/lib/python3.12/site-packages/ && \
89
89
ln -s /usr/lib/libreoffice/program/unohelper.py /opt/venv/lib/python3.12/site-packages/ && \
90
90
ln -s /usr/lib/libreoffice/program /opt/venv/lib/python3.12/site-packages/LibreOffice && \
Original file line number Diff line number Diff line change 1
1
services :
2
2
stirling-pdf :
3
3
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
5
5
deploy :
6
6
resources :
7
7
limits :
Original file line number Diff line number Diff line change @@ -147,10 +147,10 @@ public ResponseEntity<byte[]> mergePdfs(@ModelAttribute MergePdfsRequest form)
147
147
filesToDelete .add (tempFile ); // Add temp file to the list for later deletion
148
148
mergerUtility .addSource (tempFile ); // Add source file to the merger utility
149
149
}
150
-
150
+
151
151
mergedTempFile = Files .createTempFile ("merged-" , ".pdf" ).toFile ();
152
152
mergerUtility .setDestinationFileName (mergedTempFile .getAbsolutePath ());
153
-
153
+
154
154
mergerUtility .mergeDocuments (
155
155
pdfDocumentFactory .getStreamCacheFunction (totalSize )); // Merge the documents
156
156
@@ -189,14 +189,14 @@ public ResponseEntity<byte[]> mergePdfs(@ModelAttribute MergePdfsRequest form)
189
189
log .error ("Error in merge pdf process" , ex );
190
190
throw ex ;
191
191
} finally {
192
- if (mergedDocument != null ) {
192
+ if (mergedDocument != null ) {
193
193
mergedDocument .close (); // Close the merged document
194
194
}
195
195
for (File file : filesToDelete ) {
196
196
if (file != null ) {
197
197
Files .deleteIfExists (file .toPath ()); // Delete temporary files
198
198
}
199
- }
199
+ }
200
200
if (mergedTempFile != null ) {
201
201
Files .deleteIfExists (mergedTempFile .toPath ());
202
202
}
You can’t perform that action at this time.
0 commit comments