pdf-lib
pdf-lib copied to clipboard
Library not recognising all pages in a file with mixed page dimesions
What were you trying to do?
Drawing fields on a PDF document which has mixed page dimensions.
How did you attempt to do it?
Using pdfDoc.getPages();
What actually happened?
The library only recognizes first n number of pages(4 in my case where the document actually has 24 pages). ie, pdfDoc.getPages()
returns 4 and not 24.
Interestingly, all first 4 pages are of the same dimension. The fifst page is a different dimension.
What did you expect to happen?
To be able to get all the pages in the doc.
The library only recognizes first n number of pages(4 in my case where the document actually has 24 pages). ie, pdfDoc.getPages()
returns 4 and not 24.
Interestingly, all first 4 pages are of the same dimension. The fifst page is a different dimension.
How can we reproduce the issue?
Use a long document with mixed page dimensions.
Version
1.17.1
What environment are you running pdf-lib in?
Node
Checklist
- [X] My report includes a Short, Self Contained, Correct (Compilable) Example.
- [ ] I have attached all PDFs, images, and other files needed to run my SSCCE.
Additional Notes
Since this document is classified, I cannot share in public
Seeing this as well, though I can reproduce with only 2 pages. Second page is not recognized.
We still have not resolved this issue. When in the rare case of such documents, we are manually fixing them @dgavey
Will it be possible for you to share this file @dgavey ?
Came across the same error for another file as well. The PDF has 27 pages in total but the pdfDoc.getPages()
method only returns 8 pages.