0
Well I need to generate a PDF from a BLOB field saved in the database, my idea is to upload PDF transforming it into BLOB so as not to occupy disk space and facilitate the transport of the same.
I’m doing it this way:
include("../pdf/mpdf60/mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($registros->BLO_PDFXX_ARQUI);
$mpdf->Output();
exit;
where the $registros->BLO_PDFXX_ARQUI
is the code I’m trying to do. But here comes the question, with MPDF I have condition to do this ?
My other doubt is there is some managed that would facilitate me in this case of BLOB content ?
This generates for me from BLOB to pdf ?
– Renan Rodrigues
To do this just use php to treat the BLOB and create an html with the desired content and formatting. http://php.net/manual/en/function.ibase-blob-echo.php If you are not using Firebird this is another simple way: http://stackoverflow.com/questions/20556773/php-display-image-blob-from-mysql
– Phillipe Vieira
when I’m giving echo this giving internal server error
– Renan Rodrigues
am searching this way here $Bloo = ibase_blob_echo($records->BLO_PDFX_ARQUI); echo $Bloo;
– Renan Rodrigues
php error log gave this PHP error Fatal error: Call to Undefined Function ibase_blob_echo()
– Renan Rodrigues
This way it is simpler, the ibase_blob_echo function is a function available from the Firebird library. echo '<img src="data:image/jpeg;Base64,'. base64_encode(** $BLOB **).'"/>';
– Phillipe Vieira
But it’s not an image, actually the process is as follows, the guy uploads a file. pdf transforming it into blob and saved in database, now I want to recover this .pdf. file The problem occurs while recovering BLOB data
– Renan Rodrigues
You can use the same echo code '<a href="data:TYPE;Base64,'. base64_encode(** $BLOB **). '" download > Download PDF </a> ' simply change the type of the returned file and the tag.
– Phillipe Vieira