| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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
- {
- public string user { get; set; }
- public bool IsLogged { get; set; }
- /// <summary>
- /// Scale of the webpage rendering. Defaults to <c>1</c>. Scale amount must be between 0.1 and 2.
- /// </summary>
- public decimal Scale { get; set; } = 1;
-
- /// <summary>
- /// Display header and footer. Defaults to <c>false</c>
- /// </summary>
- public bool DisplayHeaderFooter { get; set; }
-
- /// <summary>
- /// HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:
- /// <c>date</c> - formatted print date
- /// <c>title</c> - document title
- /// <c>url</c> - document location
- /// <c>pageNumber</c> - current page number
- /// <c>totalPages</c> - total pages in the document
- /// </summary>
- public string HeaderTemplate { get; set; } = string.Empty;
- /// <summary>
- /// HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them:
- /// <c>date</c> - formatted print date
- /// <c>title</c> - document title
- /// <c>url</c> - document location
- /// <c>pageNumber</c> - current page number
- /// <c>totalPages</c> - total pages in the document
- /// </summary>
- public string FooterTemplate { get; set; } = string.Empty;
-
- /// <summary>
- /// Print background graphics. Defaults to <c>false</c>
- /// </summary>
- public bool PrintBackground { get; set; }
-
- /// <summary>
- /// Paper orientation.. Defaults to <c>false</c>
- /// </summary>
- public bool Landscape { get; set; }
-
- /// <summary>
- /// Paper ranges to print, e.g., <c>1-5, 8, 11-13</c>. Defaults to the empty string, which means print all pages
- /// </summary>
- public string PageRanges { get; set; } = string.Empty;
-
- /// <summary>
- /// Paper format. If set, takes priority over <see cref="Width"/> and <see cref="Height"/>
- /// </summary>
- public PaperFormatType PaperFormatType { get; set; } = PaperFormatType.A4; // Paper format from client side
-
- /// <summary>
- /// Paper width, accepts values labeled with units
- /// </summary>
- public object Width { get; set; }
-
- /// <summary>
- /// Paper height, accepts values labeled with units
- /// </summary>
- public object Height { get; set; }
-
- /// <summary>
- /// Paper margins, defaults to none
- /// </summary>
- //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";
-
- /// <summary>
- /// Give any CSS <c>@page</c> size declared in the page priority over what is declared in <c>width</c> and <c>height</c> or <c>format</c> options.
- /// Defaults to <c>false</c>, which will scale the content to fit the paper size.
- /// </summary>
- public bool PreferCSSPageSize { get; set; }
-
- /// <summary>
- /// Hides default white background and allows generating pdfs with transparency.
- /// </summary>
- public bool OmitBackground { get; set; }
- }
- }
|