DocumentSettings.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace QuestPDF.Infrastructure
  2. {
  3. public class DocumentSettings
  4. {
  5. public const int DefaultRasterDpi = 72;
  6. /// <summary>
  7. /// Gets or sets a value indicating whether or not make the document PDF/A-2b conformant.
  8. /// If true, include XMP metadata, a document UUID, and sRGB output intent information.
  9. /// This adds length to the document and makes it non-reproducable, but are necessary features for PDF/A-2b conformance.
  10. /// </summary>
  11. public bool PdfA { get; set; } = false;
  12. /// <summary>
  13. /// Encoding quality controls the trade-off between size and quality.
  14. /// When the image is opaque, it will be encoded using the JPEG format with the selected quality setting.
  15. /// When the image contains an alpha channel, it is always encoded using the PNG format and this option is ignored.
  16. /// The default value is "high quality".
  17. /// </summary>
  18. /// <remarks>
  19. /// This setting is taken into account only when the image is in the JPG format, otherwise it is ignored.
  20. /// </remarks>
  21. public ImageCompressionQuality ImageCompressionQuality { get; set; } = ImageCompressionQuality.High;
  22. /// <summary>
  23. /// The DPI (pixels-per-inch) at which images and features without native PDF support will be rasterized.
  24. /// A larger DPI would create a PDF that reflects the original intent with better fidelity, but it can make for larger PDF files too, which would use more memory while rendering, and it would be slower to be processed or sent online or to printer.
  25. /// When generating images, this parameter also controls the resolution of the generated content.
  26. /// Default value is 288.
  27. /// </summary>
  28. public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 4;
  29. public ContentDirection ContentDirection { get; set; } = ContentDirection.LeftToRight;
  30. public static DocumentSettings Default => new DocumentSettings();
  31. }
  32. }