How to print several textarea (used with Tinymce), which are written in BLOB, in a single PDF?

Asked

Viewed 72 times

0

I have several textarea (more than 20), on different pages of PHP and use Tinymce as editor of all these textarea. All are written to Mysql as BLOB, since all textarea allows text and image, and many characters in each. My problem: I can’t print every textarea in a single PDF file (I use the FPDF, but I’ve tried it with html2pdf and tb did not function). When I call the recorded fields as BLOB through a SELECT, the text until it prints (with some minor accents/ç errors, as below), but the images do not print at all, only the following comes out in the PDF instead of the image:

<img title="foto.jpg" src="data:image/jpeg;base64,/9j/4AAQSk........>

And instead of words such as "CONCEPTUALIZATION", print:

CONCEITUA&Ccedil;&Atilde;O

In the latter case, I’ve tried using utf8_decode and htmlspecialchars_decode, but it didn’t help. In the case of the image, I have no idea how to solve it, because the image usually appears in the textarea, in the Tinymce preview of the respective textarea and even in the PDF generated by Tinymce in each textarea. The problem is when I have to consolidate all the data of all textarea into a single PDF. If someone has already gone through this or knows how to solve......

1 answer

0

in a forum from another country, I received a suggestion: not to use the FPDF but to print from Tinymce’s own print (but then the user would have to have a PDF print drive on his machine, like cutepdf for example). For this, in order to print the data of all textarea, suggested to create an additional textarea, on another page, and insert in it the data of all textarea (with a PHP echo). It was not really the desired solution, because I did the tests and it takes about 20 seconds, both to load the data in the textarea, as well as to print in PDF. The timing was not an absurdity, but I believe that with the increase of data/figures in the textarea by each user, this could harm the performance when the option is full print. I share this with everyone, because the goal is to spread solutions, but I hope that some new idea, more operational than the one suggested above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.