[api-minor] Improve pdf reading in high contrast mode

- Use Canvas & CanvasText color when they don't have their default value
  as background and foreground colors.
- The colors used to draw (stroke/fill) in a pdf are replaced by the bg/fg
  ones according to their luminance.
This commit is contained in:
Calixte Denizet 2022-05-04 15:37:13 +02:00
parent 8135d7ccf6
commit c8afd6ce8c
9 changed files with 159 additions and 13 deletions

View file

@ -525,6 +525,10 @@ const PDFViewerApplication = {
useOnlyCssZoom: AppOptions.get("useOnlyCssZoom"),
maxCanvasPixels: AppOptions.get("maxCanvasPixels"),
enablePermissions: AppOptions.get("enablePermissions"),
pageColors: {
background: AppOptions.get("pageBackgroundColor"),
foreground: AppOptions.get("pageForegroundColor"),
},
});
pdfRenderingQueue.setViewer(this.pdfViewer);
pdfLinkService.setViewer(this.pdfViewer);