prawn-svg icon indicating copy to clipboard operation
prawn-svg copied to clipboard

Support for embedded SVG data URLs

Open alek3y opened this issue 3 years ago • 5 comments

It looks like images like this one are not supported (... is just to make the snippet shorter):

<image
  x="182.7" y="229.5"
  width="94.6" height="55"
  xlink:href="data:image/svg+xml;base64,PHN2ZyB4b...ZnPg=="
  preserveAspectRatio="none"
/>

I tried building a pdf with asciidoctor-pdf and the example in the readme, but both failed to show the embedded images.

alek3y avatar Nov 17 '21 20:11 alek3y

To my knowledge, prawn-svg only supports base64-encoded image/png and image/jpeg href values on the image tag.

mojavelinux avatar Nov 17 '21 20:11 mojavelinux

Hi @alek3y, yes @mojavelinux is correct. I'll update the README to be more specific about what image types prawn-svg supports.

mogest avatar Nov 17 '21 20:11 mogest

Wouldn't it be possible to also support image/svg? Some programs unfortunately embed the image as a url instead of putting its tags directly into the SVG.

alek3y avatar Nov 17 '21 21:11 alek3y

Definitely possible but there'll be a bit of work required to get it going. Happy to receive a pull request for this functionality.

On Thu, 18 Nov 2021, 10:17 am alek3y, @.***> wrote:

Wouldn't it be possible to also support image/svg? Some programs unfortunately embed the image as a url instead of putting its tags directly into the SVG.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mogest/prawn-svg/issues/144#issuecomment-972042836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFUXOM6Y3FTV3DG4UK7YDUMQLU3ANCNFSM5IH5ELNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mogest avatar Nov 18 '21 01:11 mogest

I think this issue is now duplicated by #137.

mojavelinux avatar Jun 01 '22 06:06 mojavelinux

Agreed mojavelinux, we'll track this in #137.

mogest avatar Jan 27 '24 22:01 mogest