Hi, I'm trying to load a few SVGs remotely and feed them into my PDF. I know the .svg files are loading correctly because if I print the cURL result I see them and when I copy/paste the <svg> code directly it works. However, when I try to load via cURL and then feed to ImageSVG I get the following error: TCPDF ERROR: SVG file not found: @
Hmm, no dice with file_get_contents, same error. I don't think I need any kind of cookies because if instead of calling ImageSVG on the last line I do something like print_r($svg_data) the SVG files show in the browser i.e. their data is output correctly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm trying to load a few SVGs remotely and feed them into my PDF. I know the .svg files are loading correctly because if I print the cURL result I see them and when I copy/paste the <svg> code directly it works. However, when I try to load via cURL and then feed to ImageSVG I get the following error:
TCPDF ERROR: SVG file not found: @
Here's the code I'm using:
Thanks so much for any help!
Does it work with file_get_contents() rather than curl?
Do you need it to keep a cookie jar to work?
Hmm, no dice with file_get_contents, same error. I don't think I need any kind of cookies because if instead of calling ImageSVG on the last line I do something like print_r($svg_data) the SVG files show in the browser i.e. their data is output correctly.
Is it a public url I can try?
Certainly: http://commons.wikimedia.org/wiki/SVG_examples#mediaviewer/File:SVG_example7.svg
Thanks again for the help
Last edit: Michael 2014-09-15
Hmm. Don't know what to say. It worked for me using file_get_contents.
Turns out you're right, it works with cURL too, it was a silly error I hadn't noticed but you telling me it does indeed work helped me figure it out.
Thanks for your help!