packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

Web rendering ignores background colour

Open timovandeput opened this issue 2 years ago • 0 comments

Describe the bug The default native rendering on MacOS draws a Texture with a transparent background, which allows me to add a while "paper" at the size of the page. When rendering on Web, the background is always solid white.

I tried to override the color using the backgroundColor parameter of PdfPageTexture.updateRect(), but this parameter appears to be ignored by the web renderer.

So this is about two (likely related) issues:

  1. Rendering on Web does is not by default transparent.
  2. Rendering on Web ignores the background color passed in updateRect().

Core of my problem is that I would like to render the PDF on Web without a background color.

To Reproduce NOTE: This applies to rendering directly as a PdfTexture.

Expected behavior Default rendering to Web should be transparent, just like the MacOS native renderer does.

Screenshots N/A

Smartphone (please complete the following information):

  • PDFX version 2.3.0
  • pdfjs version 2.12.313

Additional context (None)

timovandeput avatar Nov 04 '22 09:11 timovandeput