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/fpdfview.h" | 7 #include "public/fpdfview.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 return nullptr; | 290 return nullptr; |
291 | 291 |
292 if (page_index < 0 || page_index >= pDoc->GetPageCount()) | 292 if (page_index < 0 || page_index >= pDoc->GetPageCount()) |
293 return nullptr; | 293 return nullptr; |
294 | 294 |
295 CPDF_Dictionary* pDict = pDoc->GetPage(page_index); | 295 CPDF_Dictionary* pDict = pDoc->GetPage(page_index); |
296 if (!pDict) | 296 if (!pDict) |
297 return NULL; | 297 return NULL; |
298 CPDF_Page* pPage = new CPDF_Page; | 298 CPDF_Page* pPage = new CPDF_Page; |
299 pPage->Load(pDoc, pDict); | 299 pPage->Load(pDoc, pDict); |
300 pPage->ParseContent(); | 300 pPage->ParseContent(nullptr); |
301 return pPage; | 301 return pPage; |
302 } | 302 } |
303 | 303 |
304 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page) { | 304 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page) { |
305 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); | 305 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); |
306 return pPage ? pPage->GetPageWidth() : 0.0; | 306 return pPage ? pPage->GetPageWidth() : 0.0; |
307 } | 307 } |
308 | 308 |
309 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page) { | 309 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page) { |
310 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); | 310 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 if (!buffer) { | 913 if (!buffer) { |
914 *buflen = len; | 914 *buflen = len; |
915 } else if (*buflen >= len) { | 915 } else if (*buflen >= len) { |
916 memcpy(buffer, utf16Name.c_str(), len); | 916 memcpy(buffer, utf16Name.c_str(), len); |
917 *buflen = len; | 917 *buflen = len; |
918 } else { | 918 } else { |
919 *buflen = -1; | 919 *buflen = -1; |
920 } | 920 } |
921 return (FPDF_DEST)pDestObj; | 921 return (FPDF_DEST)pDestObj; |
922 } | 922 } |
OLD | NEW |