mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[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:
parent
8135d7ccf6
commit
c8afd6ce8c
9 changed files with 159 additions and 13 deletions
|
@ -648,7 +648,8 @@ class Driver {
|
|||
renderForms = false,
|
||||
renderPrint = false,
|
||||
renderXfa = false,
|
||||
annotationCanvasMap = null;
|
||||
annotationCanvasMap = null,
|
||||
pageColors = null;
|
||||
|
||||
if (task.annotationStorage) {
|
||||
const entries = Object.entries(task.annotationStorage),
|
||||
|
@ -699,6 +700,7 @@ class Driver {
|
|||
renderForms = !!task.forms;
|
||||
renderPrint = !!task.print;
|
||||
renderXfa = !!task.enableXfa;
|
||||
pageColors = task.pageColors || null;
|
||||
|
||||
// Render the annotation layer if necessary.
|
||||
if (renderAnnotations || renderForms || renderXfa) {
|
||||
|
@ -746,6 +748,7 @@ class Driver {
|
|||
viewport,
|
||||
optionalContentConfigPromise: task.optionalContentConfigPromise,
|
||||
annotationCanvasMap,
|
||||
pageColors,
|
||||
transform,
|
||||
};
|
||||
if (renderForms) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue