Add configurable PDF viewer options and improve rendering
Introduced `PdfViewerOptions` class to centralize PDF viewer settings such as scaling, HiDPI support, zoom transitions, and rendering delays. Bound these options to `appsettings.json` for dynamic configuration. Injected `PdfViewerOptions` into `EnvelopeViewer.razor` and updated `OnInitializedAsync` to pass settings to JavaScript. Replaced hardcoded values in `pdf-viewer.js` with configurable options, improving maintainability and flexibility. Enhanced rendering logic to respect HiDPI settings, maximum DPR, and smooth zoom transitions. Improved thumbnail rendering with configurable delays to optimize performance.
This commit is contained in:
@@ -14,6 +14,8 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||
builder.Services.Configure<ApiOptions>(opts =>
|
||||
builder.Configuration.GetSection(ApiOptions.SectionName).Bind(opts));
|
||||
builder.Services.Configure<PdfViewerOptions>(opts =>
|
||||
builder.Configuration.GetSection(PdfViewerOptions.SectionName).Bind(opts));
|
||||
builder.Services.AddScoped<EnvelopeGenerator.ReceiverUI.Services.DocumentService>();
|
||||
builder.Services.AddScoped<EnvelopeGenerator.ReceiverUI.Services.AuthService>();
|
||||
builder.Services.AddScoped<EnvelopeGenerator.ReceiverUI.Services.AnnotationService>();
|
||||
|
||||
Reference in New Issue
Block a user