Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering PDF which include shapes who have opacity (SVG renderer) #11812

Closed
bobsingor opened this issue Apr 15, 2020 · 1 comment · Fixed by #11927
Closed

Rendering PDF which include shapes who have opacity (SVG renderer) #11812

bobsingor opened this issue Apr 15, 2020 · 1 comment · Fixed by #11927

Comments

@bobsingor
Copy link

Attach (recommended) or Link to PDF file here:
I attached the svg as txt because of the github upload restrictions.
page3.txt
ton_page3.pdf

Configuration:
Web browser and its version: Latest Chrome (80.0.3987.149)
PDF.js version: pdfjs-dist (2.4.456)

Steps to reproduce the problem:
Use the PDF above in the SVG renderer and you will see that image in the middle has two cirlces. the right circle should have 3 circles around them that each has less opacity. In the SVG renderer these circles are rendered with full opacity.

timvandermeij added a commit to timvandermeij/pdf.js that referenced this issue May 24, 2020
In the PDF file from the issue below, the fill alpha (`CA`) is set
before drawing the circles using the `setGState` operator. Doing so
causes the global alpha to be set on the canvas' context for the canvas
back-end, but this was not handled in the SVG back-end. This patch fixes
that by taking the fill opacity into account when drawing shading
patterns in the same way as done elsewhere so it is only included if the
value is non-default.

Fixes mozilla#11812.
timvandermeij added a commit to timvandermeij/pdf.js that referenced this issue May 24, 2020
In the PDF file from the issue below, the fill alpha (`ca`) is set
before drawing the circles using the `setGState` operator. Doing so
causes the global alpha to be set on the canvas' context for the canvas
back-end, but this was not handled in the SVG back-end. This patch fixes
that by taking the fill opacity into account when drawing shading
patterns in the same way as done elsewhere so it is only included if the
value is non-default.

Fixes mozilla#11812.
@timvandermeij
Copy link
Contributor

Fixed by the pull request above.

emalysz pushed a commit to emalysz/pdf.js that referenced this issue Jun 1, 2020
In the PDF file from the issue below, the fill alpha (`ca`) is set
before drawing the circles using the `setGState` operator. Doing so
causes the global alpha to be set on the canvas' context for the canvas
back-end, but this was not handled in the SVG back-end. This patch fixes
that by taking the fill opacity into account when drawing shading
patterns in the same way as done elsewhere so it is only included if the
value is non-default.

Fixes mozilla#11812.
emalysz pushed a commit to emalysz/pdf.js that referenced this issue Jun 1, 2020
In the PDF file from the issue below, the fill alpha (`ca`) is set
before drawing the circles using the `setGState` operator. Doing so
causes the global alpha to be set on the canvas' context for the canvas
back-end, but this was not handled in the SVG back-end. This patch fixes
that by taking the fill opacity into account when drawing shading
patterns in the same way as done elsewhere so it is only included if the
value is non-default.

Fixes mozilla#11812.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants