| 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 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1989 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); | 1989 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); |
| 1990 std::string page_json; | 1990 std::string page_json; |
| 1991 base::JSONWriter::Write(node.get(), &page_json); | 1991 base::JSONWriter::Write(node.get(), &page_json); |
| 1992 return page_json; | 1992 return page_json; |
| 1993 } | 1993 } |
| 1994 | 1994 |
| 1995 bool PDFiumEngine::GetPrintScaling() { | 1995 bool PDFiumEngine::GetPrintScaling() { |
| 1996 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); | 1996 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); |
| 1997 } | 1997 } |
| 1998 | 1998 |
| 1999 int PDFiumEngine::GetCopiesToPrint() { |
| 2000 return FPDF_VIEWERREF_GetNumCopies(doc_); |
| 2001 } |
| 2002 |
| 1999 void PDFiumEngine::AppendBlankPages(int num_pages) { | 2003 void PDFiumEngine::AppendBlankPages(int num_pages) { |
| 2000 DCHECK(num_pages != 0); | 2004 DCHECK(num_pages != 0); |
| 2001 | 2005 |
| 2002 if (!doc_) | 2006 if (!doc_) |
| 2003 return; | 2007 return; |
| 2004 | 2008 |
| 2005 selection_.clear(); | 2009 selection_.clear(); |
| 2006 pending_pages_.clear(); | 2010 pending_pages_.clear(); |
| 2007 | 2011 |
| 2008 // Delete all pages except the first one. | 2012 // Delete all pages except the first one. |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3422 double* height) { | 3426 double* height) { |
| 3423 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3427 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
| 3424 if (!doc) | 3428 if (!doc) |
| 3425 return false; | 3429 return false; |
| 3426 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 3430 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 3427 FPDF_CloseDocument(doc); | 3431 FPDF_CloseDocument(doc); |
| 3428 return success; | 3432 return success; |
| 3429 } | 3433 } |
| 3430 | 3434 |
| 3431 } // namespace chrome_pdf | 3435 } // namespace chrome_pdf |
| OLD | NEW |