Welcome Guest, Not a member yet? Register   Sign In
pdf plugin help!
#1

[eluser]NachoF[/eluser]
I reeeally need to generate a pdf file from a databse query... It might get to 1000 records
Im using the dompdf plugin and Im getting this error

Quote:Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 5880 bytes)

please help
thanls in advance.
#2

[eluser]Dam1an[/eluser]
Well, the easiest way is to just increase the memoru limit, which is set in the php config (php.ini on windows)
Or do you not have access to this file?
#3

[eluser]NachoF[/eluser]
I fixed it by addind this line to the plugin
ini_set("memory_limit","256M");

Dont understand how 256 MBs of memory is necesary for a 200KB pdf.. really stupid.
#4

[eluser]überfuzz[/eluser]
[quote author="NachoF" date="1251681268"]I fixed it by addind this line to the plugin
ini_set("memory_limit","256M");

Dont understand how 256 MBs of memory is necesary for a 1MB pdf.. really stupid.[/quote]
Are you short on memory..? Undecided
#5

[eluser]Dam1an[/eluser]
[quote author="NachoF" date="1251681268"]
Dont understand how 256 MBs of memory is necesary for a 1MB pdf.. really stupid.[/quote]

I doubt you need all that 256Mb Wink
But yeah, PDF generation is pretty memory intensive, it doesn't just use as much as the resultant file size
#6

[eluser]NachoF[/eluser]
This is all on my local computer..... which has 6GBBs of RAM... I dont know the specs of the deployment server.... in any case.. what other approach do you reccomend?? instead of pdf... the user just wants a list of the all the attending students (out of 1200)... I just though it would be better if it was a pdf but he might as well print out a large html file and be done with it if its gonna risk the reliability of the system.... so... any ideas on a better way?
#7

[eluser]überfuzz[/eluser]
You could have a go with the css. It's possible to alter print style. If you put out a <table> you can style it to look good on paper.

Example:
Code:
@media print {
    #header,#menu,#logo {
    display:none;
    }
    
    body {
    font-size:70%;
    }

    p,li,ul,ol,h1,h2,h3,h4,h5,td{
    font-family: serif;
    }

}




Theme © iAndrew 2016 - Forum software by © MyBB