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/edit/cpdf_creator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fpdfapi/edit') diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index 38abb85822..590229bf4f 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -624,7 +624,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4() { } if (m_pParser) { - CPDF_Dictionary* p = m_pParser->GetTrailer(); + std::unique_ptr p = m_pParser->GetCombinedTrailer(); for (const auto& it : *p) { const ByteString& key = it.first; CPDF_Object* pValue = it.second.get(); -- cgit v1.2.3