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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/fpdfedit.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 // #include "x:/pdf/fpdfapi5/include/fpdfapi.h" 7 // #include "x:/pdf/fpdfapi5/include/fpdfapi.h"
8 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 #include "../include/fpdfedit.h" 9 #include "../include/fpdfedit.h"
10 10
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 pRectArray->SetAt(2,FX_NEW CPDF_Number(rect.right)); 307 pRectArray->SetAt(2,FX_NEW CPDF_Number(rect.right));
308 pRectArray->SetAt(3,FX_NEW CPDF_Number(rect.top)); 308 pRectArray->SetAt(3,FX_NEW CPDF_Number(rect.top));
309 pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray); 309 pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray);
310 310
311 //Transform AP's rectangle 311 //Transform AP's rectangle
312 //To Do 312 //To Do
313 313
314 } 314 }
315 315
316 } 316 }
317
318 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate)
319 {
320 CPDF_Page* pPage = (CPDF_Page*)page;
321 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type ")
322 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin g().Compare("Page"))
323 {
324 return;
325 }
326 CPDF_Dictionary* pDict = pPage->m_pFormDict;
327 rotate %=4;
328
329 pDict->SetAt("Rotate", FX_NEW CPDF_Number(rotate * 90));
330 }
OLDNEW
« 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