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 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2450 } | 2450 } |
2451 | 2451 |
2452 bool PDFiumEngine::GetPrintScaling() { | 2452 bool PDFiumEngine::GetPrintScaling() { |
2453 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); | 2453 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); |
2454 } | 2454 } |
2455 | 2455 |
2456 int PDFiumEngine::GetCopiesToPrint() { | 2456 int PDFiumEngine::GetCopiesToPrint() { |
2457 return FPDF_VIEWERREF_GetNumCopies(doc_); | 2457 return FPDF_VIEWERREF_GetNumCopies(doc_); |
2458 } | 2458 } |
2459 | 2459 |
| 2460 int PDFiumEngine::GetDuplexType() { |
| 2461 return static_cast<int>(FPDF_VIEWERREF_GetDuplex(doc_)); |
| 2462 } |
| 2463 |
2460 void PDFiumEngine::AppendBlankPages(int num_pages) { | 2464 void PDFiumEngine::AppendBlankPages(int num_pages) { |
2461 DCHECK(num_pages != 0); | 2465 DCHECK(num_pages != 0); |
2462 | 2466 |
2463 if (!doc_) | 2467 if (!doc_) |
2464 return; | 2468 return; |
2465 | 2469 |
2466 selection_.clear(); | 2470 selection_.clear(); |
2467 pending_pages_.clear(); | 2471 pending_pages_.clear(); |
2468 | 2472 |
2469 // Delete all pages except the first one. | 2473 // Delete all pages except the first one. |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3994 double* height) { | 3998 double* height) { |
3995 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 3999 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
3996 if (!doc) | 4000 if (!doc) |
3997 return false; | 4001 return false; |
3998 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4002 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
3999 FPDF_CloseDocument(doc); | 4003 FPDF_CloseDocument(doc); |
4000 return success; | 4004 return success; |
4001 } | 4005 } |
4002 | 4006 |
4003 } // namespace chrome_pdf | 4007 } // namespace chrome_pdf |
OLD | NEW |