Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: pdf/pdfium/pdfium_engine.cc

Issue 974183003: Print Preview: Support the duplex preset in PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2459 } 2459 }
2460 2460
2461 bool PDFiumEngine::GetPrintScaling() { 2461 bool PDFiumEngine::GetPrintScaling() {
2462 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); 2462 return !!FPDF_VIEWERREF_GetPrintScaling(doc_);
2463 } 2463 }
2464 2464
2465 int PDFiumEngine::GetCopiesToPrint() { 2465 int PDFiumEngine::GetCopiesToPrint() {
2466 return FPDF_VIEWERREF_GetNumCopies(doc_); 2466 return FPDF_VIEWERREF_GetNumCopies(doc_);
2467 } 2467 }
2468 2468
2469 int PDFiumEngine::GetDuplexType() {
2470 return static_cast<int>(FPDF_VIEWERREF_GetDuplex(doc_));
2471 }
2472
2469 void PDFiumEngine::AppendBlankPages(int num_pages) { 2473 void PDFiumEngine::AppendBlankPages(int num_pages) {
2470 DCHECK(num_pages != 0); 2474 DCHECK(num_pages != 0);
2471 2475
2472 if (!doc_) 2476 if (!doc_)
2473 return; 2477 return;
2474 2478
2475 selection_.clear(); 2479 selection_.clear();
2476 pending_pages_.clear(); 2480 pending_pages_.clear();
2477 2481
2478 // Delete all pages except the first one. 2482 // Delete all pages except the first one.
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
3999 double* height) { 4003 double* height) {
4000 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); 4004 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL);
4001 if (!doc) 4005 if (!doc)
4002 return false; 4006 return false;
4003 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 4007 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
4004 FPDF_CloseDocument(doc); 4008 FPDF_CloseDocument(doc);
4005 return success; 4009 return success;
4006 } 4010 }
4007 4011
4008 } // namespace chrome_pdf 4012 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698