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

Why SVG images using <path> elements create larger file sizes than those using <defs> elements? #719

Open
sdespont opened this issue May 14, 2024 · 0 comments

Comments

@sdespont
Copy link

I've compared two SVG images: one created using the element (31kB) and the other using and elements (76kB).

I don't understand why the SVG image created with is larger (19kB) compared to the image (15kB). What could be causing this discrepancy?

I'm asking this question because I'm writing files with numerous SVG images. I assumed that using a more powerful and compact format like would result in smaller file sizes. Are there any options I could apply to achieve this?

require_once('tcpdf_include.php');
$pdf = new TCPDF('P', 'mm', 'A4', true, 'ISO-8859-1');
$pdf->AddPage();
$pdf->ImageSVG("images/5.0.8.svg", 100, 100, 46, 46);
$pdf->lastPage();
$pdf->Output(__DIR__.'/example_006.pdf', 'F');
@sdespont sdespont changed the title Why do SVG images using <path> elements result in larger file sizes than those using <defs> elements? Why SVG images using <path> elements create larger file sizes than those using <defs> elements? May 14, 2024
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

No branches or pull requests

1 participant