| 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" |
| (...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); | 2380 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); |
| 2381 std::string page_json; | 2381 std::string page_json; |
| 2382 base::JSONWriter::Write(node.get(), &page_json); | 2382 base::JSONWriter::Write(node.get(), &page_json); |
| 2383 return page_json; | 2383 return page_json; |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 bool PDFiumEngine::GetPrintScaling() { | 2386 bool PDFiumEngine::GetPrintScaling() { |
| 2387 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); | 2387 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); |
| 2388 } | 2388 } |
| 2389 | 2389 |
| 2390 int PDFiumEngine::GetCopiesToPrint() { |
| 2391 return FPDF_VIEWERREF_GetNumCopies(doc_); |
| 2392 } |
| 2393 |
| 2390 void PDFiumEngine::AppendBlankPages(int num_pages) { | 2394 void PDFiumEngine::AppendBlankPages(int num_pages) { |
| 2391 DCHECK(num_pages != 0); | 2395 DCHECK(num_pages != 0); |
| 2392 | 2396 |
| 2393 if (!doc_) | 2397 if (!doc_) |
| 2394 return; | 2398 return; |
| 2395 | 2399 |
| 2396 selection_.clear(); | 2400 selection_.clear(); |
| 2397 pending_pages_.clear(); | 2401 pending_pages_.clear(); |
| 2398 | 2402 |
| 2399 // Delete all pages except the first one. | 2403 // Delete all pages except the first one. |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3892 double* height) { | 3896 double* height) { |
| 3893 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3897 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
| 3894 if (!doc) | 3898 if (!doc) |
| 3895 return false; | 3899 return false; |
| 3896 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3900 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 3897 FPDF_CloseDocument(doc); | 3901 FPDF_CloseDocument(doc); |
| 3898 return success; | 3902 return success; |
| 3899 } | 3903 } |
| 3900 | 3904 |
| 3901 } // namespace chrome_pdf | 3905 } // namespace chrome_pdf |
| OLD | NEW |