pdfjs
pdfjs copied to clipboard
The document could not be saved. There was a problem reading this document (23)
Hi ! An error displays when saving a downloaded PDF report from the web - "The document could not be saved. There was a problem reading this document (23)."
Deselecting Acrobat "Save As Optimizes for Fast Web View" works but I was wondering if it could be fixed when generating de pdf? Thanks !
Hi, in which browser are you opening and saving the document, and you are using an acrobat browser extension I presume?
Hi, Chrome without the acrobat extension. But it's seems to be related to acrobat reader itself. Just like here: https://support.delivra.com/hc/en-us/articles/360000843853-I-get-an-Adobe-Acrobat-error-when-saving-a-report-as-PDF
I think I am still doing it wrong when trying to reproduce. This is what I am doing:
- Open http://pdfjs.rkusa.st/ in Chrome
- Download the resulting PDF (using the download button in the top right of the PDF viewer)
- Try to open the PDF in Acrobat Reader DC
Acrobat Reader DC opens the download PDF without an error.
Can you advice me on what I might do wrong trying to reproduce the issue? Thanks!
Hi ! Here is a code sample: `"use strict";
const pdf = require("pdfjs"); const fs = require("fs");
const doc = new pdf.Document({ font: require("pdfjs/font/Helvetica"), fontSize: 13, padding: 42, lineHeight: 1, width: 792, height: 612, });
doc.pipe(fs.createWriteStream("test.pdf"));
doc._cursor.y = 140;
const alias = doc._fontAlias(doc.defaultFont);
const text2 = doc.text({ font: require("pdfjs/font/Helvetica-Bold"), fontSize: 14, textAlign: "center", color: "0x9A9B9C", }); text2.add("Hello!\n\n");
doc.end();`
And when I try to save it whit "Save As optimizes for Fast Web View" in Acrobat, it gives me this error: test.pdf
It downloads but I cannot save it:
Thanks for the additional details, I am able to reproduce it now. Though I have no idea yet what the issue might be, especially since the error message lacks details and I couldn't find any use full logs.
Anyone found a fix?