mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Support custom pageColors
in the thumbnails (PR 14874)
Currently, when non-standard `pageColors` are specified, the thumbnails will look inconsistent depending on how they're created. The thumbnails that are created by downsizing the *page* canvases will obviously use the `pageColors` as intended, however the thumbnails which are rendered *directly* will always use the default colors.
This commit is contained in:
parent
5b02c685d6
commit
9871761949
4 changed files with 52 additions and 12 deletions
|
@ -269,13 +269,15 @@ class BaseViewer {
|
|||
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||
if (
|
||||
options.pageColors &&
|
||||
(!CSS.supports("color", options.pageColors.background) ||
|
||||
!CSS.supports("color", options.pageColors.foreground))
|
||||
this.pageColors &&
|
||||
!(
|
||||
CSS.supports("color", this.pageColors.background) &&
|
||||
CSS.supports("color", this.pageColors.foreground)
|
||||
)
|
||||
) {
|
||||
if (options.pageColors.background || options.pageColors.foreground) {
|
||||
if (this.pageColors.background || this.pageColors.foreground) {
|
||||
console.warn(
|
||||
"Ignoring `pageColors`-option, since the browser doesn't support the values used."
|
||||
"BaseViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."
|
||||
);
|
||||
}
|
||||
this.pageColors = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue