1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PRINTING_NUP_PARAMETERS_H_
6 #define PRINTING_NUP_PARAMETERS_H_
8 #include "printing/printing_export.h"
12 class PRINTING_EXPORT NupParameters {
16 // Whether or not the input |pages_per_sheet| is a supported N-up value.
17 // Supported values are: 1 2 4 6 9 16
18 static bool IsSupported(int pages_per_sheet);
20 // Orientation of the to-be-generated N-up PDF document.
21 bool landscape() const { return landscape_; };
22 int num_pages_on_x_axis() const { return num_pages_on_x_axis_; };
23 int num_pages_on_y_axis() const { return num_pages_on_y_axis_; };
25 // Calculates the |num_pages_on_x_axis_|, |num_pages_on_y_axis_| and
26 // |landscape_| based on the input. |is_source_landscape| is true if the
27 // source document orientation is landscape.
28 // Callers should check |pages_per_sheet| values with IsSupported() first,
29 // and only pass in supported values.
30 void SetParameters(int pages_per_sheet, bool is_source_landscape);
32 // Turns off N-up mode by resetting |num_pages_on_x_axis| = 1,
33 // |num_pages_on_y_axis| = 1, and |landscape_| = false
37 int num_pages_on_x_axis_;
38 int num_pages_on_y_axis_;
42 } // namespace printing
44 #endif // PRINTING_NUP_PARAMETERS_H_