We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to read the pdf file which is present in react repo root directory which is under public folder, "sample.pdf"
const formUrl = '/sample.pdf'; const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer()); const pdfBufferData = await PDFDocument.load(formPdfBytes); console.log('arrayBuffer', formPdfBytes.byteLength); console.log('pdfBuffer', pdfBufferData);
I am getting the below exception, the arrayBufffer
Failed to parse PDF document (line:104 col:8 offset=195965): No PDF header found
It should load the PDFDocument.load(pdfBytes)
By running the above code in react project .js file,,,,,,
^1.17.1
Browser, Other
nothing
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What were you trying to do?
I need to read the pdf file which is present in react repo root directory which is under public folder, "sample.pdf"
How did you attempt to do it?
const formUrl = '/sample.pdf';
const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer());
const pdfBufferData = await PDFDocument.load(formPdfBytes);
console.log('arrayBuffer', formPdfBytes.byteLength);
console.log('pdfBuffer', pdfBufferData);
What actually happened?
I am getting the below exception, the arrayBufffer
Failed to parse PDF document (line:104 col:8 offset=195965): No PDF header found
What did you expect to happen?
It should load the PDFDocument.load(pdfBytes)
How can we reproduce the issue?
By running the above code in react project .js file,,,,,,
Version
^1.17.1
What environment are you running pdf-lib in?
Browser, Other
Checklist
Additional Notes
nothing
The text was updated successfully, but these errors were encountered: