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

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: tsepez comments 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
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | ppapi/c/private/ppp_pdf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698