| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include "pdf/pdfium/pdfium_engine.h" | 5 #include "pdf/pdfium/pdfium_engine.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // Font loading doesn't work in the renderer sandbox in Linux. | 511 // Font loading doesn't work in the renderer sandbox in Linux. |
| 512 FPDF_SetSystemFontInfo(&g_font_info); | 512 FPDF_SetSystemFontInfo(&g_font_info); |
| 513 #endif | 513 #endif |
| 514 | 514 |
| 515 FSDK_SetUnSpObjProcessHandler(&g_unsupported_info); | 515 FSDK_SetUnSpObjProcessHandler(&g_unsupported_info); |
| 516 | 516 |
| 517 return true; | 517 return true; |
| 518 } | 518 } |
| 519 | 519 |
| 520 void ShutdownSDK() { | 520 void ShutdownSDK() { |
| 521 FPDF_DestroyLibrary(); |
| 521 TearDownV8(); | 522 TearDownV8(); |
| 522 FPDF_DestroyLibrary(); | |
| 523 } | 523 } |
| 524 | 524 |
| 525 PDFEngine* PDFEngine::Create(PDFEngine::Client* client) { | 525 PDFEngine* PDFEngine::Create(PDFEngine::Client* client) { |
| 526 return new PDFiumEngine(client); | 526 return new PDFiumEngine(client); |
| 527 } | 527 } |
| 528 | 528 |
| 529 PDFiumEngine::PDFiumEngine(PDFEngine::Client* client) | 529 PDFiumEngine::PDFiumEngine(PDFEngine::Client* client) |
| 530 : client_(client), | 530 : client_(client), |
| 531 current_zoom_(1.0), | 531 current_zoom_(1.0), |
| 532 current_rotation_(0), | 532 current_rotation_(0), |
| (...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3873 FPDF_DOCUMENT doc = | 3873 FPDF_DOCUMENT doc = |
| 3874 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 3874 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
| 3875 if (!doc) | 3875 if (!doc) |
| 3876 return false; | 3876 return false; |
| 3877 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3877 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 3878 FPDF_CloseDocument(doc); | 3878 FPDF_CloseDocument(doc); |
| 3879 return success; | 3879 return success; |
| 3880 } | 3880 } |
| 3881 | 3881 |
| 3882 } // namespace chrome_pdf | 3882 } // namespace chrome_pdf |
| OLD | NEW |