Skip to content

Slanted SVG image #124

@truongwp

Description

@truongwp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions