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

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

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 pages_[index]->GetAccessibleContentAsValue(current_rotation_)); 1974 pages_[index]->GetAccessibleContentAsValue(current_rotation_));
1975 std::string page_json; 1975 std::string page_json;
1976 base::JSONWriter::Write(node.get(), &page_json); 1976 base::JSONWriter::Write(node.get(), &page_json);
1977 return page_json; 1977 return page_json;
1978 } 1978 }
1979 1979
1980 bool PDFiumEngine::GetPrintScaling() { 1980 bool PDFiumEngine::GetPrintScaling() {
1981 return !!FPDF_VIEWERREF_GetPrintScaling(doc_); 1981 return !!FPDF_VIEWERREF_GetPrintScaling(doc_);
1982 } 1982 }
1983 1983
1984 int PDFiumEngine::GetNumCopies() {
1985 return FPDF_VIEWERREF_GetNumCopies(doc_);
1986 }
1987
1984 void PDFiumEngine::AppendBlankPages(int num_pages) { 1988 void PDFiumEngine::AppendBlankPages(int num_pages) {
1985 DCHECK(num_pages != 0); 1989 DCHECK(num_pages != 0);
1986 1990
1987 if (!doc_) 1991 if (!doc_)
1988 return; 1992 return;
1989 1993
1990 selection_.clear(); 1994 selection_.clear();
1991 pending_pages_.clear(); 1995 pending_pages_.clear();
1992 1996
1993 // Delete all pages except the first one. 1997 // Delete all pages except the first one.
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
3400 if (page_width > *max_page_width) { 3404 if (page_width > *max_page_width) {
3401 *max_page_width = page_width; 3405 *max_page_width = page_width;
3402 } 3406 }
3403 } 3407 }
3404 } 3408 }
3405 FPDF_CloseDocument(doc); 3409 FPDF_CloseDocument(doc);
3406 return true; 3410 return true;
3407 } 3411 }
3408 3412
3409 } // namespace chrome_pdf 3413 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698