chromium/components/printing/browser/print_to_pdf/pdf_print_utils.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/printing/browser/print_to_pdf/pdf_print_utils.h"

#include <string_view>

#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/printing/common/print_params.h"
#include "printing/print_settings.h"
#include "printing/units.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/size_f.h"
#include "url/url_canon.h"

namespace print_to_pdf {

namespace {

// The max and min value should match the ones in scaling_settings.html.
// Update both files at the same time.
static constexpr double kScaleMaxVal =;
static constexpr double kScaleMinVal =;
// Set default margin to 1.0cm = ~2/5 of an inch.
static constexpr double kDefaultMarginInMM =;
static constexpr double kMMPerInch =;
static constexpr double kDefaultMarginInInches =;

}  // namespace

absl::variant<printing::PageRanges, PdfPrintResult> TextPageRangesToPageRanges(
    std::string_view page_range_text) {}

absl::variant<printing::mojom::PrintPagesParamsPtr, std::string>
GetPrintPagesParams(const GURL& page_url,
                    std::optional<bool> landscape,
                    std::optional<bool> display_header_footer,
                    std::optional<bool> print_background,
                    std::optional<double> scale,
                    std::optional<double> paper_width,
                    std::optional<double> paper_height,
                    std::optional<double> margin_top,
                    std::optional<double> margin_bottom,
                    std::optional<double> margin_left,
                    std::optional<double> margin_right,
                    std::optional<std::string> header_template,
                    std::optional<std::string> footer_template,
                    std::optional<bool> prefer_css_page_size,
                    std::optional<bool> generate_tagged_pdf,
                    std::optional<bool> generate_document_outline) {}

}  // namespace print_to_pdf