Koha-clms/Koha/pdfformat
David Cook b82c0ddd5f
Bug 38516: Use PDF template copy for exporting PDFs
Due to a bug in PDF::API2 or related libraries,
you cannot export a PDF if you do not have write
permission on the PDF template. We bypass this
problem by taking a string copy of the PDF template
and working on that instead.

Test plan:
0. DO NOT APPLY THE PATCH YET
1. chmod 444 /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/pdf/*.pdf
2. Create a basket with a vendor
3. Add an order to the basket
4. Close basket (and attach the basket to a new basket group with the same name)
5. Go to "Closed" tab and click "Export as PDF"
6. Note that you get an error when you try to open it in Adobe or some other PDF program

7. Apply the patch and restart koha (e.g. koha-plack --restart kohadev)

8. Try to "Export as PDF" again
9. Note that this time there is no warning and your PDF opens just fine
10. Repeat the "Export as PDF" process for every option of the
system preference "OrderPdfFormat". Every option should work
without errors.
11. Celebrate!

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a6ba625592)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 020e862d32)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-04 14:54:53 +01:00
..
layout1page.pm Bug 38516: Use PDF template copy for exporting PDFs 2025-12-04 14:54:53 +01:00
layout2pages.pm Bug 38516: Use PDF template copy for exporting PDFs 2025-12-04 14:54:53 +01:00
layout2pagesde.pm Bug 38516: Use PDF template copy for exporting PDFs 2025-12-04 14:54:53 +01:00
layout3pages.pm Bug 38516: Use PDF template copy for exporting PDFs 2025-12-04 14:54:53 +01:00
layout3pagesfr.pm Bug 38516: Use PDF template copy for exporting PDFs 2025-12-04 14:54:53 +01:00