document_properties.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2021 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.
  4. #ifndef PDF_UI_DOCUMENT_PROPERTIES_H_
  5. #define PDF_UI_DOCUMENT_PROPERTIES_H_
  6. #include <string>
  7. #include "pdf/document_metadata.h"
  8. #include "third_party/abseil-cpp/absl/types/optional.h"
  9. namespace gfx {
  10. class Size;
  11. } // namespace gfx
  12. namespace chrome_pdf {
  13. // Formats `size_points` of a page to a localized string suitable for display to
  14. // the user. The returned string contains the dimensions and orientation of the
  15. // page. The dimension units are set by the user's locale. Example return
  16. // values:
  17. // -> 210 x 297 mm (portrait)
  18. // -> 11.00 x 8.50 in (landscape)
  19. //
  20. // Returns the string "Varies" if `size_points` is `absl::nullopt`.
  21. std::u16string FormatPageSize(const absl::optional<gfx::Size>& size_points);
  22. // Formats `version` to a string suitable for display to a user. Version numbers
  23. // do not require localization.
  24. std::string FormatPdfVersion(PdfVersion version);
  25. } // namespace chrome_pdf
  26. #endif // PDF_UI_DOCUMENT_PROPERTIES_H_