Robin
Robin

Reputation: 323

Embedding SVG XML in tcpdf

I'm using tcpdf to generate PDF files with PHP and I have no problem embedding SVG images in the form of .svg files containing the XML markup that is representation of the image. However, I would like to be able to use that XML, for example as a PHP string, and supply it to tcpdf directly, without the need of storing it in a file.

Is this possible somehow?

Upvotes: 4

Views: 2498

Answers (1)

Robin
Robin

Reputation: 323

I found the solution by checking the source code of tcpdf (and then I saw that it is actually in the documentation as well; I just missed it): instead of supplying a filename, it is possible to supply the XML string preceded by a @.

Upvotes: 7

Related Questions