using System.ComponentModel; using PuppeteerSharp; using PuppeteerSharp.Media; namespace BlackRock.Reporting.API.Core.Models { public class BaseEntity { public Guid Id { get; set; } } public enum PaperFormatType{ A4 = 0, A3 = 1, Letter = 2 } public class OptionsForPdf { /// /// Scale of the webpage rendering. Defaults to 1. Scale amount must be between 0.1 and 2. /// public decimal Scale { get; set; } = 1; /// /// Display header and footer. Defaults to false /// public bool DisplayHeaderFooter { get; set; } /// /// HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: /// date - formatted print date /// title - document title /// url - document location /// pageNumber - current page number /// totalPages - total pages in the document /// public string HeaderTemplate { get; set; } = string.Empty; /// /// HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them: /// date - formatted print date /// title - document title /// url - document location /// pageNumber - current page number /// totalPages - total pages in the document /// public string FooterTemplate { get; set; } = string.Empty; /// /// Print background graphics. Defaults to false /// public bool PrintBackground { get; set; } /// /// Paper orientation.. Defaults to false /// public bool Landscape { get; set; } /// /// Paper ranges to print, e.g., 1-5, 8, 11-13. Defaults to the empty string, which means print all pages /// public string PageRanges { get; set; } = string.Empty; /// /// Paper format. If set, takes priority over and /// public PaperFormatType PaperFormatType {get; set;} = PaperFormatType.A4; // Paper format from client side /// /// Paper width, accepts values labeled with units /// public object Width { get; set; } /// /// Paper height, accepts values labeled with units /// public object Height { get; set; } /// /// Paper margins, defaults to none /// //public MarginOptions MarginOptions { get; set; } = new MarginOptions(){Top="3.0 mm",Right = "3.0 mm",Left="3.0 mm",Bottom="12.7 mm"}; public string MarginTop {get;set;} ="6.0 mm"; public string MarginRight {get;set;} = "3.0 mm"; public string MarginLeft {get;set;} ="3.0 mm"; public string MarginBottom {get;set;} ="12.7 mm"; /// /// Give any CSS @page size declared in the page priority over what is declared in width and height or format options. /// Defaults to false, which will scale the content to fit the paper size. /// public bool PreferCSSPageSize { get; set; } /// /// Hides default white background and allows generating pdfs with transparency. /// public bool OmitBackground { get; set; } } }