laravel-fpdf icon indicating copy to clipboard operation
laravel-fpdf copied to clipboard

Feature/optimize

Open poncianodiego opened this issue 3 years ago • 3 comments

  • Adds option to use the memory optimization extension through an .env variable

poncianodiego avatar Jul 08 '22 21:07 poncianodiego

@codedge full proposal here 🚀

poncianodiego avatar Jul 13 '22 21:07 poncianodiego

Sorry, but it is totally unclear to me what problem this PR should solve.

Regarding the FPDF_FONTPATH I merged a PR #169 that allows setting the FPDF_FONTPATH env var and thus let you define a different font path. So please remove these changes from this PR.

Memory optimization Please explain what the original problem is, and how you solve it with this PR. Also resolve the conflicts, please.

codedge avatar Jul 22 '22 09:07 codedge

@codedge it will optimize memory, when you are producing a large PDF file it might time out, this PR allows you to create the PDF file on the very first PDF page, then it will append every new page, hence optimizing the memory required to "hold" all the pages and therefore it will not timeout. See more details on the plugin’s link. By the plugin's words:

"The standard FPDF class builds the document entirely in memory, which can be problematic for large documents. This extension saves the pages to the destination file as soon as they are finished, which solves the issue."

poncianodiego avatar Jul 22 '22 16:07 poncianodiego