diff options
author | xlou <xlou@chromium.org> | 2018-10-15 21:38:42 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-15 21:38:42 +0000 |
commit | 1123794330298b00a40ca35e9ada3ac2d6a664f3 (patch) | |
tree | f5e3a4a72d6bcee6ab91334949dee6d2555986f9 /fpdfsdk/fpdf_ppo.cpp | |
parent | d250099e0eca3c804873cc08b8a3a73cab89725d (diff) | |
download | pdfium-1123794330298b00a40ca35e9ada3ac2d6a664f3.tar.xz |
Use CropBox instead of ArtBox or TrimBox
FPDFPage_Flatten() used ArtBox as the BBbox of the newly created
XObject, which in some situation, some content of the generated
PDF are not visible.
FPDF_ImportNPagesToOne() uses TrimBox as the BBbox of the newly
created XObject, which in some cases, MediaBox and CropBox are
scaled up, however TrimBox is not, which caused some content of
the newly generated N-upped PDF not visible.
Hence for the above two situations, we have chosen to use mostly
commonly used CropBox.
Bug:409670
Change-Id: Ifb82a6f881d7ce1802cf23c7e8e6f11cc76bf3e9
Reviewed-on: https://pdfium-review.googlesource.com/c/43987
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Shirleen Lou <xlou@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_ppo.cpp')
-rw-r--r-- | fpdfsdk/fpdf_ppo.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp index 8f0b0c3d79..fd270d997c 100644 --- a/fpdfsdk/fpdf_ppo.cpp +++ b/fpdfsdk/fpdf_ppo.cpp @@ -185,12 +185,6 @@ CFX_FloatRect GetCropBox(const CPDF_Dictionary* pPageDict) { return GetMediaBox(pPageDict); } -CFX_FloatRect GetTrimBox(const CPDF_Dictionary* pPageDict) { - if (pPageDict->KeyExist("TrimBox")) - return pPageDict->GetRectFor("TrimBox"); - return GetCropBox(pPageDict); -} - const CPDF_Object* GetPageOrganizerPageContent( const CPDF_Dictionary* pPageDict) { return pPageDict @@ -702,7 +696,7 @@ uint32_t CPDF_NPageToOneExporter::MakeXObject( pNewXObjectDict->SetNewFor<CPDF_Name>("Type", "XObject"); pNewXObjectDict->SetNewFor<CPDF_Name>("Subtype", "Form"); pNewXObjectDict->SetNewFor<CPDF_Number>("FormType", 1); - pNewXObjectDict->SetRectFor("BBox", GetTrimBox(pSrcPageDict)); + pNewXObjectDict->SetRectFor("BBox", GetCropBox(pSrcPageDict)); // TODO(xlou): add matrix field to pNewXObjectDict. if (const CPDF_Array* pSrcContentArray = ToArray(pSrcContentObj)) { |