summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-06-08 20:40:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-08 20:40:15 +0000
commitfc615c63d34037896963f636e4b5d9e05efd41de (patch)
tree30ab4b41c8eaf07297ff1255b2d62c1cccde9377 /fpdfsdk/fpdf_editpage.cpp
parent8ef4ef26481d8ed80d33b898bcff829fa7c0999c (diff)
downloadpdfium-fc615c63d34037896963f636e4b5d9e05efd41de.tar.xz
Add constants for PDF 1.7 spec, table 3.27.
BUG=pdfium:1049 Change-Id: Ie8bdb893d2af8d63420027a7ef95baf58cd97aa6 Reviewed-on: https://pdfium-review.googlesource.com/34691 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 0a8a74577b..d8b39b4d08 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "constants/page_object.h"
#include "core/fpdfapi/edit/cpdf_pagecontentgenerator.h"
#include "core/fpdfapi/page/cpdf_form.h"
#include "core/fpdfapi/page/cpdf_formobject.h"
@@ -186,9 +187,10 @@ FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDFPage_New(FPDF_DOCUMENT document,
if (!pPageDict)
return nullptr;
- pPageDict->SetRectFor("MediaBox", CFX_FloatRect(0, 0, width, height));
- pPageDict->SetNewFor<CPDF_Number>("Rotate", 0);
- pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
+ pPageDict->SetRectFor(pdfium::page_object::kMediaBox,
+ CFX_FloatRect(0, 0, width, height));
+ pPageDict->SetNewFor<CPDF_Number>(pdfium::page_object::kRotate, 0);
+ pPageDict->SetNewFor<CPDF_Dictionary>(pdfium::page_object::kResources);
#ifdef PDF_ENABLE_XFA
auto* pContext = static_cast<CPDFXFA_Context*>(pDoc->GetExtension());
@@ -492,7 +494,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetRotation(FPDF_PAGE page,
return;
rotate %= 4;
- pPage->GetDict()->SetNewFor<CPDF_Number>("Rotate", rotate * 90);
+ pPage->GetDict()->SetNewFor<CPDF_Number>(pdfium::page_object::kRotate,
+ rotate * 90);
}
FPDF_BOOL FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object,