@@ -13,6 +13,7 @@ $options = new QROptions([
'outputType' => QRCode::OUTPUT_FPDF,
'eccLevel' => QRCode::ECC_L,
'scale' => 5,
+ 'imageBase64' => false,
'moduleValues' => [
// finder
1536 => [0, 63, 255], // dark (true)
@@ -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;
@@ -77,7 +77,8 @@ class QRFpdfTest extends QROutputTestAbstract{
* @dataProvider types
*/
public function testRenderImage(string $type):void{
- $this->options->outputType = $type;
+ $this->options->outputType = $type;
+ $this->options->imageBase64 = false;
// substr() to avoid CreationDate
$expected = substr(file_get_contents(__DIR__.'/samples/'.$type), 0, 2500);