1

Hi everybody!

At first I want to apologize beacuse of my french level. It is close to zero so, with permissions, I will write in english.

I find this library very usefull, but I was trying to create dinamic charts. At first I found it easy using the tag "draw" but when I tried to insert text in the chart I began to find problems. I got success puting some text in the chart frame but with no style.

Then I decided to generate the svg file with my application and tried to imbued in a <img> tag, but HTML2PDF doesn't support that kind of image. So I went to html2pdf.class and I made some changes

1st Step: Change method _drawImage($src,$subLi)
protected function _drawImage($src, $subLi=false)
{
// get the size of the image
// WARNING : if URL, "allow_url_fopen" must turned to "on" in php.ini
$infos=@getimagesize($src);

// if the image does not exist, or can not be loaded
if (count($infos)<2) {
// if the test is activ => exception
if(substr($src,-3) == 'svg'){ ///There is where I did changes
$this->_drawSVG($src,$subLi);
}elseif
($this->_testIsImage) {
throw new HTML2PDF_exception(6, $src);
}

// else, display a gray rectangle
$src = null;
$infos = array(16, 16);
}
..... the method contínue.....

2nd Step: Create method _drawSVG($src, $subLiy)
protected function _drawSVG($src, $subLiy)
{
$this->pdf->ImageSVG($file=$src, $x=50, $y=100, $w='100', $h='100', $link='', $align='', $palign='', $border=1, $fitonpage=true);
}

this method just call the TCPDF method for rendering SVG images.

And finally it works I can use "complex" SVG files.