mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 03:58:28 +00:00
:octocat: allow base64 encoding for SVG and PDF output
This commit is contained in:
@@ -102,6 +102,10 @@ class QRFpdf extends QROutputAbstract{
|
||||
$this->saveToFile($pdfData, $file);
|
||||
}
|
||||
|
||||
if($this->options->imageBase64){
|
||||
$pdfData = sprintf('data:application/pdf;base64,%s', base64_encode($pdfData));
|
||||
}
|
||||
|
||||
return $pdfData;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,10 @@ class QRMarkup extends QROutputAbstract{
|
||||
return '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'.$this->options->eol.$svg;
|
||||
}
|
||||
|
||||
if($this->options->imageBase64){
|
||||
$svg = sprintf('data:image/svg+xml;base64,%s', base64_encode($svg));
|
||||
}
|
||||
|
||||
return $svg;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user