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 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/numerics/safe_conversions.h" |
12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
17 #include "base/values.h" | 18 #include "base/values.h" |
18 #include "pdf/draw_utils.h" | 19 #include "pdf/draw_utils.h" |
19 #include "pdf/pdfium/pdfium_api_string_buffer_adapter.h" | 20 #include "pdf/pdfium/pdfium_api_string_buffer_adapter.h" |
20 #include "pdf/pdfium/pdfium_mem_buffer_file_read.h" | 21 #include "pdf/pdfium/pdfium_mem_buffer_file_read.h" |
21 #include "pdf/pdfium/pdfium_mem_buffer_file_write.h" | 22 #include "pdf/pdfium/pdfium_mem_buffer_file_write.h" |
(...skipping 4005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4027 double* height) { | 4028 double* height) { |
4028 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 4029 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
4029 if (!doc) | 4030 if (!doc) |
4030 return false; | 4031 return false; |
4031 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4032 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
4032 FPDF_CloseDocument(doc); | 4033 FPDF_CloseDocument(doc); |
4033 return success; | 4034 return success; |
4034 } | 4035 } |
4035 | 4036 |
4036 } // namespace chrome_pdf | 4037 } // namespace chrome_pdf |
OLD | NEW |