Provide the wasReconstructed value to the caller
This MR modifies poppler's PDFDoc
class to provide a method to check whether the xref table
has been reconstructed or not indicating that the file might be broken. For the poppler library itself:
- Refactored the
wasReconstructed
variable insidePDFDoc::setup()
to be an instance variable of thePDFDoc
- Created a getter method for it
For poppler-qt5:
- Created a wrapper method inside the
Document
class, in which we just call the loadedPDFDoc
instancecheckIfReconstructed
method
For qt5 demos:
- Show a message box indicating that the PDF might be broken if we detected it using the added method in poppler-qt5
I tried testing the implementation using a sample PDF file where I just added some bytes to the content of the file and it detected that it may be broken. However, when I tried modifying the addresses of the objects in the xref table
of the file, it didn't detect that the xref
has been reconstructed when we're fetching the objects in the fetch()
method.
FIXES #416 (closed)