Skip to content
New issue

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

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

Already on GitHub? # to your account

Slanted SVG image #124

Open
truongwp opened this issue Jul 22, 2024 · 3 comments
Open

Slanted SVG image #124

truongwp opened this issue Jul 22, 2024 · 3 comments
Milestone

Comments

@truongwp
Copy link

truongwp commented Jul 22, 2024

Hello. Thanks for creating a great library.

After upgrading to v3.0, my SVG image is slanted. This is my code:

$html = '
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>Test PDF</title>
</head>

<body>
	<div>Test content
		<img src="http://frmdev.test/wp-content/plugins/formidable-pro/images/doc.svg" />
	</div>
</body>
</html>
';

$dompdf = new Dompdf(
	array(
		'enable_remote' => true,
	)
);
$dompdf->loadHtml( $html );
$dompdf->render();
$dompdf->stream();

The PDF output:
Screenshot 2024-07-22 at 14 24 04

This is the HTML output:
Screenshot 2024-07-22 at 14 25 03

This is the SVG code:

<svg width="56" height="56" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.552 49.241h25.862a3 3 0 003-3V20.035L31.138 6.759H15.552a3 3 0 00-3 3V46.24a3 3 0 003 3z" fill="#28A8C6"/><path fill="#fff" d="M17.862 25.345h21.241V28H17.862zM17.862 30.655h21.241v2.655H17.862zM17.862 35.965h14.603v2.655H17.862z"/><path d="M34.138 20.035h10.276L31.138 6.759v10.276a3 3 0 003 3z" fill="#6BD3EB"/></svg>

This is the SVG file:
doc.svg.zip

This only happens with SVG images.

@bsweeney
Copy link
Member

Can you provide a copy of the SVG document?

@truongwp
Copy link
Author

Sorry. I added the SVG code and file in the issue description.

@bsweeney
Copy link
Member

OK yeah, I'm seeing the slant as well with that image. The problem is with SvgLib, so I'll move this issue to that project.

@bsweeney bsweeney transferred this issue from dompdf/dompdf Jul 23, 2024
@bsweeney bsweeney added this to the 1.0.1 milestone Jul 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants