summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfeditpage.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-06-12 13:41:50 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-06-12 13:41:50 -0700
commit394010d55368f6d2e2d64fff0b7fc22d7f59ba53 (patch)
treedbc1c56313801c9b36bb989738e1f02d48a91ad1 /fpdfsdk/src/fpdfeditpage.cpp
parenta5572c3715624b38ac861c87236185f98fa9083b (diff)
downloadpdfium-394010d55368f6d2e2d64fff0b7fc22d7f59ba53.tar.xz
Add FPDFPage_SetRotation function
R=jam@chromium.org Review URL: https://codereview.chromium.org/336563004
Diffstat (limited to 'fpdfsdk/src/fpdfeditpage.cpp')
-rw-r--r--fpdfsdk/src/fpdfeditpage.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index 3f22b56b48..4c9fd35108 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -314,3 +314,17 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
}
}
+
+DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return;
+ }
+ CPDF_Dictionary* pDict = pPage->m_pFormDict;
+ rotate %=4;
+
+ pDict->SetAt("Rotate", FX_NEW CPDF_Number(rotate * 90));
+} \ No newline at end of file