pdf_render_settings.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright (c) 2011 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 PRINTING_PDF_RENDER_SETTINGS_H_
  5. #define PRINTING_PDF_RENDER_SETTINGS_H_
  6. #include "build/build_config.h"
  7. #include "ui/gfx/geometry/point.h"
  8. #include "ui/gfx/geometry/rect.h"
  9. #include "ui/gfx/geometry/size.h"
  10. namespace printing {
  11. // Defining PDF rendering settings.
  12. struct PdfRenderSettings {
  13. enum Mode {
  14. NORMAL = 0,
  15. #if BUILDFLAG(IS_WIN)
  16. TEXTONLY,
  17. POSTSCRIPT_LEVEL2,
  18. POSTSCRIPT_LEVEL3,
  19. EMF_WITH_REDUCED_RASTERIZATION,
  20. POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS,
  21. LAST = POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS
  22. #else
  23. LAST = NORMAL
  24. #endif
  25. };
  26. PdfRenderSettings()
  27. : autorotate(false), use_color(true), mode(Mode::NORMAL) {}
  28. PdfRenderSettings(const gfx::Rect& area,
  29. const gfx::Point& offsets,
  30. const gfx::Size& dpi,
  31. bool autorotate,
  32. bool use_color,
  33. Mode mode)
  34. : area(area),
  35. offsets(offsets),
  36. dpi(dpi),
  37. autorotate(autorotate),
  38. use_color(use_color),
  39. mode(mode) {}
  40. ~PdfRenderSettings() {}
  41. gfx::Rect area;
  42. gfx::Point offsets;
  43. gfx::Size dpi;
  44. bool autorotate;
  45. bool use_color;
  46. Mode mode;
  47. };
  48. } // namespace printing
  49. #endif // PRINTING_PDF_RENDER_SETTINGS_H_