diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-11-08 16:19:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-08 16:19:50 +0000 |
commit | 20f22a0a38a6c6d9ccd0ead2e65093e79f0bd051 (patch) | |
tree | a02ebaf3432516a879d356748545552aa78fb8b0 /core/fpdfapi/parser/cpdf_parser.h | |
parent | 9a93484a61fe0e9b8a4a4c664f596857eb78f819 (diff) | |
download | pdfium-20f22a0a38a6c6d9ccd0ead2e65093e79f0bd051.tar.xz |
Fix FPDF_SaveAsCopy for linearized PDFs.
Only the last trailer was written to the new PDF. In linearized PDFs,
this means Info and Root were not copied to the newly written PDF.
This CL makes CPDF_Parser remember the Root and provide that to
CPDF_Creator.
Bug: pdfium:614
Change-Id: Ia61f5f6a337f7de3010ee0ed39b022c1b2732ea2
Reviewed-on: https://pdfium-review.googlesource.com/17987
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_parser.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index 375bc01621..45b8cb9f2e 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -57,7 +57,13 @@ class CPDF_Parser { void SetPassword(const char* password) { m_Password = password; } ByteString GetPassword() { return m_Password; } + CPDF_Dictionary* GetTrailer() const; + + // Returns a new trailer which combines the last read trailer with the /Root + // and /Info from previous ones. + std::unique_ptr<CPDF_Dictionary> GetCombinedTrailer() const; + FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } uint32_t GetPermissions() const; |