| 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 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); | 1968 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); |
| 1969 std::string page_json; | 1969 std::string page_json; |
| 1970 base::JSONWriter::Write(node.get(), &page_json); | 1970 base::JSONWriter::Write(node.get(), &page_json); |
| 1971 return page_json; | 1971 return page_json; |
| 1972 } | 1972 } |
| 1973 | 1973 |
| 1974 bool PDFiumEngine::GetPrintScaling() { | 1974 bool PDFiumEngine::GetPrintScaling() { |
| 1975 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); | 1975 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 int PDFiumEngine::GetCopiesToPrint() { |
| 1979 return FPDF_VIEWERREF_GetNumCopies(doc_); |
| 1980 } |
| 1981 |
| 1978 void PDFiumEngine::AppendBlankPages(int num_pages) { | 1982 void PDFiumEngine::AppendBlankPages(int num_pages) { |
| 1979 DCHECK(num_pages != 0); | 1983 DCHECK(num_pages != 0); |
| 1980 | 1984 |
| 1981 if (!doc_) | 1985 if (!doc_) |
| 1982 return; | 1986 return; |
| 1983 | 1987 |
| 1984 selection_.clear(); | 1988 selection_.clear(); |
| 1985 pending_pages_.clear(); | 1989 pending_pages_.clear(); |
| 1986 | 1990 |
| 1987 // Delete all pages except the first one. | 1991 // Delete all pages except the first one. |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3395 double* height) { | 3399 double* height) { |
| 3396 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3400 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
| 3397 if (!doc) | 3401 if (!doc) |
| 3398 return false; | 3402 return false; |
| 3399 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3403 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 3400 FPDF_CloseDocument(doc); | 3404 FPDF_CloseDocument(doc); |
| 3401 return success; | 3405 return success; |
| 3402 } | 3406 } |
| 3403 | 3407 |
| 3404 } // namespace chrome_pdf | 3408 } // namespace chrome_pdf |
| OLD | NEW |