diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-10-18 16:14:37 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2022-10-27 07:54:59 +0200 |
commit | 3f9e8ac6172f5b1dfd2869ee1c6aea4f24d3f480 (patch) | |
tree | 6ae6d6bda239a001b3cc4827935d4215bc0156ac /include/vcl/filter | |
parent | bdb76c9ff1832041fa7a9bda30e8d4d7d937ff94 (diff) |
vcl: re-exporting broken pdfs -> empty pages
Certain pdf documents when loaded in LO_IMPORT_USE_PDFIUM=1 mode even if
pdf-version < v1.6 sometimes has missing objects referred by other
objects for determing its stream length for instance. As a result
parsing fails and results in a pdf with empty pages. A round trip
through pdfium and exporting to v1.6 seems to cure the issue. Possibly
it does some repairing work to determine the length of the stream in a
independent pass through the file.
Conflicts:
vcl/source/filter/ipdf/pdfread.cxx
Change-Id: Id09f67eddab4163ed12a3a3f3a73baf92e2912aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141856
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'include/vcl/filter')
-rw-r--r-- | include/vcl/filter/pdfdocument.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index dd03029227d2..fbe0be89cdc6 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -576,6 +576,8 @@ public: //@{ /// Read elements from the start of the stream till its end. bool Read(SvStream& rStream); + /// Calls Read() first and if it fails it tries to fixup and then retry. + bool ReadWithPossibleFixup(SvStream& rStream); void SetSignatureLine(std::vector<sal_Int8>&& rSignatureLine); void SetSignaturePage(size_t nPage); /// Sign the read document with xCertificate in the edit buffer. |