How to print multiple textarea (used with TinyMCE), which are recorded in BLOB, in a single PDF?

0

I have several textarea (over 20) on different pages of PHP and I use TinyMCE as the editor for all of these textarea. All are written in MySQL as BLOB, since all textarea allow text and image, and many characters in each. My problem: I can not print all textarea in a single PDF file (I use FPDF, but I already tried with html2pdf and tb did not work). When I call the fields recorded as BLOB via a SELECT, the text until it prints (with a few minor accent errors / ç, as below), but the images do not print at all, only the following exits in the PDF in place of the image :

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

And instead of words, such as "CONCEPT", prints:

CONCEITUA&Ccedil;&Atilde;O

In the latter case, I've already tried to use utf8_decode and htmlspecialchars_decode , but it did not work. 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 data from all textarea into a single PDF. If someone has already experienced this or knows how to solve ......

    
asked by anonymous 03.08.2018 / 04:37

1 answer

0

In a forum from another country, I got a suggestion: not to use FPDF, but to print from TinyMCE's own print (but then the user would have to have a PDF print drive like cutepdf on his machine) . For this, in order to print the data of all textarea, they suggested to create an additional textarea, in another page, and insert in it the data of all textarea (with an echo of PHP). It was not quite the solution I wanted, since I took the tests and it takes about 20 seconds, both to load the data in the textarea as well as to print in PDF. The time was not absurd, but I believe that with the increase of data / figures in the textarea by each user, this could come to undermine the performance when the option is the total impression. 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, will come up.

    
06.08.2018 / 01:36