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_transformpage.h" | 7 #include "../../public/fpdf_transformpage.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 | 9 |
10 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo
ttom, float right, float top) | 10 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo
ttom, float right, float top) |
(...skipping 21 matching lines...) Expand all Loading... |
32 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; | 32 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; |
33 CPDF_Array* pCropBoxArray = new CPDF_Array; | 33 CPDF_Array* pCropBoxArray = new CPDF_Array; |
34 pCropBoxArray->Add(new CPDF_Number(left)); | 34 pCropBoxArray->Add(new CPDF_Number(left)); |
35 pCropBoxArray->Add(new CPDF_Number(bottom)); | 35 pCropBoxArray->Add(new CPDF_Number(bottom)); |
36 pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(right))); | 36 pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(right))); |
37 pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(top))); | 37 pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(top))); |
38 pPageDict->SetAt("CropBox", pCropBoxArray); | 38 pPageDict->SetAt("CropBox", pCropBoxArray); |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 DLLEXPORT FX_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, floa
t* bottom, float* right, float* top) | 42 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, fl
oat* bottom, float* right, float* top) |
43 { | 43 { |
44 if(!page) | 44 if(!page) |
45 return FALSE; | 45 return FALSE; |
46 CPDF_Page* pPage = (CPDF_Page*)page; | 46 CPDF_Page* pPage = (CPDF_Page*)page; |
47 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; | 47 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; |
48 CPDF_Array* pArray = pPageDict->GetArray("MediaBox"); | 48 CPDF_Array* pArray = pPageDict->GetArray("MediaBox"); |
49 if(pArray) | 49 if(pArray) |
50 { | 50 { |
51 *left = pArray->GetFloat(0); | 51 *left = pArray->GetFloat(0); |
52 *bottom = pArray->GetFloat(1); | 52 *bottom = pArray->GetFloat(1); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 { | 311 { |
312 pContentArray = new CPDF_Array(); | 312 pContentArray = new CPDF_Array(); |
313 pContentArray->AddReference(pDoc,pStream->GetObj
Num()); | 313 pContentArray->AddReference(pDoc,pStream->GetObj
Num()); |
314 pContentArray->AddReference(pDoc,pDirectObj->Get
ObjNum()); | 314 pContentArray->AddReference(pDoc,pDirectObj->Get
ObjNum()); |
315 pPageDic->SetAtReference("Contents", pDoc, pDoc-
>AddIndirectObject(pContentArray)); | 315 pPageDic->SetAtReference("Contents", pDoc, pDoc-
>AddIndirectObject(pContentArray)); |
316 } | 316 } |
317 } | 317 } |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
OLD | NEW |