Skip to content

[Bug]: White border in viewer for PDFs with background color #18694

@roland-strasser

Description

@roland-strasser

Attach (recommended) or Link to PDF file

test.pdf

Web browser and its version

130.0 (64-Bit)

Operating system and its version

Windows 10

PDF.js version

Stable (v4.6.82)

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

1.) Create a PDF with a background color other than plain white
2.) Open the PDF in the viewer
3.) Increase/Decrease the zoom level until a white border appears on the right/bottom edge of the page.

What is the expected behavior?

There is no white line between the PDFs background and the background of the viewer.

grafik

What went wrong?

grafik

Link to a viewer

No response

Additional context

It looks like there is a rounding error for the height and width of the #viewer .page element. My workaround was to set background-color: var(--body-bg-color); in the .pdfViewer .page CSS selector.

Maybe related: #18680

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions