public PdfGenerator( IPdfOptionsService pdfOptionsService, IOptionsMonitor <PdfOptions> pdfOptionsMonitor, IOptionsMonitor <PdfGeneratorOptions> pdfGeneratorMonitor) { _pdfOptionsMonitor = pdfOptionsMonitor; _pdgGeneratorOptions = pdfGeneratorMonitor.CurrentValue; pdfGeneratorMonitor.OnChange(o => _pdgGeneratorOptions = o); _pdfOptionsService = pdfOptionsService ?? throw new System.ArgumentNullException(nameof(pdfOptionsService)); }
public static IServiceCollection AddPdfGenerator(this IServiceCollection services, PdfGeneratorOptions options, IWebProxy webProxy) { return(services .AddSingleton <IChartBuilder, ChartJsBuilder>() .AddSingleton <IPdfGeneratorHttpClient>(_ => new PdfGeneratorHttpClient(options) { Proxy = webProxy }) .AddTransient <IRequestBuilder, RequestBuilder>() .AddTransient <IReportBuilder, ReportBuilder>() .AddTransient <ITableBuilder, TableBuilder>()); }
public PdfGeneratorAuthenticator(PdfGeneratorOptions PdfGeneratorOptions) { this.Options = PdfGeneratorOptions; }
public PdfGeneratorHttpClient(PdfGeneratorOptions options) : this(new PdfGeneratorAuthenticator(options)) { }
/// <summary> /// Uses: configuration["PdfGenerator:AccessToken"] /// </summary> /// <param name="configuration"></param> public PdfGeneratorHttpClient(IConfiguration configuration) : this(PdfGeneratorOptions.Create(configuration[$"PdfGenerator:{nameof(PdfGeneratorOptions.AccessToken)}"], configuration[$"PdfGenerator:{nameof(PdfGeneratorOptions.ApplicationId)}"], configuration[$"PdfGenerator:{nameof(PdfGeneratorOptions.ApplicationId)}"])) { }
public PdfGenerator(IOptions <PdfGeneratorOptions> options, IPdfOptionsConverter converter) { _pdfGeneratorOptions = options.Value; _converter = converter; }