PHPPdf icon indicating copy to clipboard operation
PHPPdf copied to clipboard

Is possible to support base64 src based?

Open didix16 opened this issue 8 years ago • 2 comments

Hi, I dunno if this project is abandoned or not but in case not, could be possible to add support for base64 url?

Thanks in advance :)

didix16 avatar Jun 22 '17 10:06 didix16

You mean in img tag right? If so create new Node extending img Node and override createSource function with something like (Imagine required):

    $temp = tempnam(sys_get_temp_dir(), 'TMP_');
    (new Imagine())->load(base64_decode($this->getAttribute('src')))->save($temp, ['format' => 'png']);
    return new \PHPPdf\Core\Engine\ZF\Image($temp);

Armstrong1992 avatar Jul 11 '17 10:07 Armstrong1992

Yes. Okay thank you so much. I'll try it :) 👍

didix16 avatar Jul 13 '17 15:07 didix16