From 20f22a0a38a6c6d9ccd0ead2e65093e79f0bd051 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 8 Nov 2017 16:19:50 +0000 Subject: 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 Commit-Queue: Henrique Nakashima --- core/fpdfapi/parser/cpdf_parser.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/fpdfapi/parser/cpdf_parser.h') 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 GetCombinedTrailer() const; + FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } uint32_t GetPermissions() const; -- cgit v1.2.3