:octocat: allow base64 encoding for SVG and PDF output

This commit is contained in:
codemasher
2020-11-18 17:00:07 +01:00
parent 3bd9eba64f
commit 6ecb09f01b
5 changed files with 14 additions and 3 deletions
+4
View File
@@ -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;
}
+4
View File
@@ -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;
}