OLD | NEW |
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 "../../public/fpdf_edit.h" | 7 #include "../../public/fpdf_edit.h" |
8 #include "../../public/fpdf_formfill.h" | 8 #include "../../public/fpdf_formfill.h" |
9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 CPDF_Dictionary* pInfoDict = NULL; | 35 CPDF_Dictionary* pInfoDict = NULL; |
36 pInfoDict = pDoc->GetInfo(); | 36 pInfoDict = pDoc->GetInfo(); |
37 if (pInfoDict) { | 37 if (pInfoDict) { |
38 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) | 38 if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) |
39 pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr)); | 39 pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr)); |
40 pInfoDict->SetAt("Creator", new CPDF_String(L"PDFium")); | 40 pInfoDict->SetAt("Creator", new CPDF_String(L"PDFium")); |
41 } | 41 } |
42 | 42 |
43 return pDoc; | 43 return FPDFDocumentFromCPDFDocument(pDoc); |
44 } | 44 } |
45 | 45 |
46 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { | 46 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { |
47 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 47 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
48 if (!pDoc || page_index < 0 || page_index >= pDoc->GetPageCount()) | 48 if (!pDoc || page_index < 0 || page_index >= pDoc->GetPageCount()) |
49 return; | 49 return; |
50 | 50 |
51 pDoc->DeletePage(page_index); | 51 pDoc->DeletePage(page_index); |
52 } | 52 } |
53 | 53 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || | 306 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || |
307 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( | 307 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( |
308 "Page")) { | 308 "Page")) { |
309 return; | 309 return; |
310 } | 310 } |
311 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 311 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
312 rotate %= 4; | 312 rotate %= 4; |
313 | 313 |
314 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); | 314 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); |
315 } | 315 } |
OLD | NEW |