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)); |
+} |