<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Reusing the same image multiple times but store only once in the PDF]]></title><description><![CDATA[<p>Is it possible to reuse resources multiple times inside of a PDF in order to not bloat the PDF with multiple copies of the same image? Also, I need this to work within SVG tags because I'm overlaying the images with svg graphics.</p>
<p>My use case:</p>
<ol>
<li>Show one large original image on one page</li>
<li>Show multiple different crops (viewbox) of the same image inside of svg elements on other pages</li>
</ol>
<p>Here are some idéas that I don't think will fly:</p>
<ol>
<li>
<p>define the image as an svg resource with <code>&lt;defs&gt;</code> and use it multiple times with <code>&lt;use&gt;</code>. I need many separate svg tags and defs is only scoped to the current svg parent, so this won't work.</p>
</li>
<li>
<p>load the image as a background image defined in a css class. The background image concept does not seem to work for images inside of svgs.</p>
</li>
</ol>
<p>Any other suggestions?</p>
<p>My fallback solution will be to have a server generate all the croped jpg images to minimize the size. Viewbox only hides parts of the image, but the complete image is still stored in the pdf multiple times.</p>
]]></description><link>https://forum.jsreport.net/topic/3208/reusing-the-same-image-multiple-times-but-store-only-once-in-the-pdf</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 23:18:45 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3208.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 May 2024 08:03:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Reusing the same image multiple times but store only once in the PDF on Invalid Date]]></title><description><![CDATA[<p>Is it possible to reuse resources multiple times inside of a PDF in order to not bloat the PDF with multiple copies of the same image? Also, I need this to work within SVG tags because I'm overlaying the images with svg graphics.</p>
<p>My use case:</p>
<ol>
<li>Show one large original image on one page</li>
<li>Show multiple different crops (viewbox) of the same image inside of svg elements on other pages</li>
</ol>
<p>Here are some idéas that I don't think will fly:</p>
<ol>
<li>
<p>define the image as an svg resource with <code>&lt;defs&gt;</code> and use it multiple times with <code>&lt;use&gt;</code>. I need many separate svg tags and defs is only scoped to the current svg parent, so this won't work.</p>
</li>
<li>
<p>load the image as a background image defined in a css class. The background image concept does not seem to work for images inside of svgs.</p>
</li>
</ol>
<p>Any other suggestions?</p>
<p>My fallback solution will be to have a server generate all the croped jpg images to minimize the size. Viewbox only hides parts of the image, but the complete image is still stored in the pdf multiple times.</p>
]]></description><link>https://forum.jsreport.net/post/13709</link><guid isPermaLink="true">https://forum.jsreport.net/post/13709</guid><dc:creator><![CDATA[msageryd]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>