#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 {
static constexpr double kScaleMaxVal = …;
static constexpr double kScaleMinVal = …;
static constexpr double kDefaultMarginInMM = …;
static constexpr double kMMPerInch = …;
static constexpr double kDefaultMarginInInches = …;
}
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) { … }
}