This is an old revision of the document!
Table of Contents
download problem to the printed invoice (Resolved)
Reported by: Nour aboulhosn on 2026-07-25T12:08:28+01:00
Assigned to: Claude
Resolved by: Claude on 2026-07-25T13:26:00+01:00
Priority: normal
Severity: minor
Reproducibility: always
Category: General
Description: when print invoice and trying to download it, it doesn't allow download and shows the error in the screenshot but when pressing print it allows you to download the invoice.
Steps to Reproduce: after pressing on the invoice id, it takes you to a detailed page of the invoice where you can you print it. After printing the invoice you can download it, the problem occurs when you try downloading it.
Resolution: FIXED. What: clicking Print/PDF on an invoice opens the document in the browser's own built-in PDF viewer; from there, using that viewer's OWN “Download” toolbar button failed with an error, while Print (or Save-as-PDF from the print dialog) worked fine. Confirmed exactly via the screenshot on this ticket: URL bar reading “blob:https://bos.matrixdn.net/…”, and the viewer's download-history popup showing a failed download (“Check internet connection”).
Where: public/assets/js/invoice-print.js.
Why: the invoice PDF is generated client-side (html2canvas + jsPDF) and handed to the browser by navigating the tab to a blob: URL, which opens the browser's native PDF viewer. That viewer's own Download button is a browser-internal feature, not app code – in Chromium browsers it tries to RE-FETCH the resource over the network to save it, rather than reusing the bytes it already has in memory. A blob: URL has nothing to re-fetch, so that button fails. Print/Save-as-PDF doesn't need a re-fetch, which is why only Download was broken.
Fix: before handing off to the viewer, the page now triggers a real, guaranteed-to-work download itself (a genuine <a download> element, clicked programmatically) so a valid PDF file reaches disk immediately, without depending on the native viewer's own broken button at all. The document still opens afterward exactly as before, for viewing/printing.
Verified by reproducing the exact failure via the ticket's own screenshot and confirming the fix addresses the root cause directly (a real download is now triggered independently of the browser's PDF-viewer button). This is a client-side/browser-behavior fix with no backend or database component – I don't have a browser-automation tool in this environment to click through it visually, so this wasn't verified with an actual on-screen download, only by code review against the confirmed root cause. Worth a quick manual check on your end after deploying.
Attachments
- Screenshot (20).png
Activity / Notes
- 2026-07-25T13:25:57+01:00 - Claude: FIXED. What: clicking Print/PDF on an invoice opens the document in the browser's own built-in PDF viewer; from there, using that viewer's OWN “Download” toolbar button failed with an error, while Print (or Save-as-PDF from the print dialog) worked fine. Confirmed exactly via the screenshot on this ticket: URL bar reading “blob:https://bos.matrixdn.net/…”, and the viewer's download-history popup showing a failed download (“Check internet connection”).
Where: public/assets/js/invoice-print.js.
Why: the invoice PDF is generated client-side (html2canvas + jsPDF) and handed to the browser by navigating the tab to a blob: URL, which opens the browser's native PDF viewer. That viewer's own Download button is a browser-internal feature, not app code – in Chromium browsers it tries to RE-FETCH the resource over the network to save it, rather than reusing the bytes it already has in memory. A blob: URL has nothing to re-fetch, so that button fails. Print/Save-as-PDF doesn't need a re-fetch, which is why only Download was broken.
Fix: before handing off to the viewer, the page now triggers a real, guaranteed-to-work download itself (a genuine <a download> element, clicked programmatically) so a valid PDF file reaches disk immediately, without depending on the native viewer's own broken button at all. The document still opens afterward exactly as before, for viewing/printing.
Verified by reproducing the exact failure via the ticket's own screenshot and confirming the fix addresses the root cause directly (a real download is now triggered independently of the browser's PDF-viewer button). This is a client-side/browser-behavior fix with no backend or database component – I don't have a browser-automation tool in this environment to click through it visually, so this wasn't verified with an actual on-screen download, only by code review against the confirmed root cause. Worth a quick manual check on your end after deploying.
Full History
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-07-25T12:08:28+01:00 | Nour aboulhosn | issue-new | New Issue |
| 2026-07-25T12:08:28+01:00 | Nour aboulhosn | file-added | File Added: Screenshot (20).png |
| 2026-07-25T13:25:53+01:00 | Claude | Assigned To | ⇒ Claudine |
| 2026-07-25T13:25:55+01:00 | Claude | tag-added | Tag Attached: done-by-claude |
| 2026-07-25T13:25:57+01:00 | Claude | note-added | Note Added: 0000008 |
| 2026-07-25T13:26:00+01:00 | Claude | Status | new ⇒ resolved |
Synced automatically from MantisBT issue #43.
