Mysql
 SQL >> Datenbank >  >> RDS >> Mysql

Ein erzeugtes PDF in einer MySQL-Datenbank speichern

Die Antwort steht schon in deinem Code:

// Close and output PDF document // **This method has several options**, check the source code documentation for more information. $pdf->Output('example_001.pdf', 'I'); 

Laut Dokumentation steuert der zweite Parameter den Ausgabemodus. Um das PDF als String zu erhalten, statt es an den Browser zu senden, ändere deinen Code zu:

$pdffilecontent = $pdf->Output('', 'S'); 

Diesen String $pdffilecontent speicherst du anschließend in der Datenbank – eine BLOB- oder LONGBLOB-Spalte ist dafür ideal.