mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +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
|
@ -129,6 +129,16 @@ const defaultOptions = {
|
|||
compatibility: compatibilityParams.maxCanvasPixels,
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
pageBackgroundColor: {
|
||||
/** @type {string} */
|
||||
value: "Canvas",
|
||||
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||
},
|
||||
pageForegroundColor: {
|
||||
/** @type {string} */
|
||||
value: "CanvasText",
|
||||
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||
},
|
||||
pdfBugEnabled: {
|
||||
/** @type {boolean} */
|
||||
value: typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue