| 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 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_page.h" | 10 #include "../include/fpdfxfa/fpdfxfa_page.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 pCropBoxArray->Add(FX_NEW CPDF_Number(left)); | 37 pCropBoxArray->Add(FX_NEW CPDF_Number(left)); |
| 38 pCropBoxArray->Add(FX_NEW CPDF_Number(bottom)); | 38 pCropBoxArray->Add(FX_NEW CPDF_Number(bottom)); |
| 39 pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); | 39 pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); |
| 40 pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); | 40 pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); |
| 41 | 41 |
| 42 | 42 |
| 43 pPageDict->SetAt("CropBox", pCropBoxArray); | 43 pPageDict->SetAt("CropBox", pCropBoxArray); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 DLLEXPORT FX_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, floa
t* bottom, float* right, float* top) | 47 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, fl
oat* bottom, float* right, float* top) |
| 48 { | 48 { |
| 49 if(!page) | 49 if(!page) |
| 50 return FALSE; | 50 return FALSE; |
| 51 CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); | 51 CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); |
| 52 if (!pPage) return FALSE; | 52 if (!pPage) return FALSE; |
| 53 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; | 53 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; |
| 54 CPDF_Array* pArray = pPageDict->GetArray("MediaBox"); | 54 CPDF_Array* pArray = pPageDict->GetArray("MediaBox"); |
| 55 if(pArray) | 55 if(pArray) |
| 56 { | 56 { |
| 57 *left = pArray->GetFloat(0); | 57 *left = pArray->GetFloat(0); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 { | 325 { |
| 326 pContentArray = FX_NEW CPDF_Array(); | 326 pContentArray = FX_NEW CPDF_Array(); |
| 327 pContentArray->AddReference(pDoc,pStream->GetObj
Num()); | 327 pContentArray->AddReference(pDoc,pStream->GetObj
Num()); |
| 328 pContentArray->AddReference(pDoc,pDirectObj->Get
ObjNum()); | 328 pContentArray->AddReference(pDoc,pDirectObj->Get
ObjNum()); |
| 329 pPageDic->SetAtReference("Contents", pDoc, pDoc-
>AddIndirectObject(pContentArray)); | 329 pPageDic->SetAtReference("Contents", pDoc, pDoc-
>AddIndirectObject(pContentArray)); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| OLD | NEW |