Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1175)

Unified Diff: fpdfsdk/src/fpdfeditpage.cpp

Issue 336563004: Add FPDFPage_SetRotation function (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/fpdfedit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfeditpage.cpp
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index 3f22b56b48435d94afe9b1c82f3ca528bb00d57a..4c9fd351088ebc0501a69522484a90b7f083afc3 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 previous file with comments | « fpdfsdk/include/fpdfedit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698