Memory problems dompdf

I use DOMPDF to create about 500 reports from a single script. It runs out of memory after creating about 10-15 PDF files.

On debugging, it looks like it loads 8M every time it is loaded into the font loading stuff, but it looks like it should be handled with the font caching code.

Any ideas on what's going wrong here? I would like to post a simple piece of code, but most of it is abstracted into several layers, so this is not just a simple copy / paste.

+3
source share
3 answers

, - , Prince XML. , HTML PDF ( ). .

-, , , . , script, . - script, , .

HTML + CSS PDF PHP?.

+1
+2

cletus, DOMPDF, , . script, script ( exec), . DOMPDF, , .

It is hard to say what would otherwise happen with respect to memory usage without any example demonstrating the problem. I do not believe that DOMPDF optimization and CPDF rendering engine for multiple instances in one script. Therefore, the font is probably loaded into memory each time, although it can use a static variable to cache this data.

+1
source

Source: https://habr.com/ru/post/1734179/


All Articles