Summary: | Add a PDF download option to print a report based on a notice | ||
---|---|---|---|
Product: | Koha | Reporter: | Esther Melander <esther.melander> |
Component: | Reports | Assignee: | Bugs List <koha-bugs> |
Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, carthur, dcook, rcoert |
Version: | 24.05 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
Esther Melander
2024-10-24 16:36:54 UTC
(In reply to Esther Melander from comment #0) > From here it is confusing to know how to print the report. The option is to > Download the rendered report. The language used here does not lead the user > to know that they can print the rendered report. The process requires > downloading the report, opening it with the browser, and then print. > > It would be nice to offer a Download PDF option right up front. A PDF is a > known file format that users know can be printed. This is done for spine > labels and table export options. It would be nice here. Technically speaking, reports rendered using templates work very differently from spine labels and table export options. Spine labels are very simple bits of text that get transformed into PDFs using a Perl library. The table export options (if they're the ones I'm thinking of) use the third-party Javascript library pdfmake within the third-party DataTables Javascript libraries to PDF them to turn a JSON structure into a PDF. The existing workflow you describe leverages the browser's built-in HTML to PDF capabilities. Technically, bug 14251 added the Python tool weasyprint which can turn HTML into PDF, but... I'm still not 100% convinced it was the right move. Technically, I suppose there could be a "template_to_pdf" option to write the HTML file to disk and then weasyprint could be used to PDF it, and then Koha could proxy that file to the user. However, this all assumes that the template output of the report is actually HTML. Technically speaking, you could use a template to output any sort of data format you wanted. So I'm not really sure how feasible this is. |