diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2022-10-18 16:14:37 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-10-26 20:38:17 +0200 |
commit | 03a0b41ba21f7d546160c819e088e0b0023b68bb (patch) | |
tree | 29a418835b326abf2f6ff568d9ef433572cb78de /include | |
parent | 00b552c02efe3bc157218dc8452a2cf87714ca0b (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.
Change-Id: Id09f67eddab4163ed12a3a3f3a73baf92e2912aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141854
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-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. |