Tcpdf is not able to write thousands of records - php

I am using tcpdf library in my one of the project and the issue i am facing is while trying to add more than 1000 records using with table structure using writeHtml or Writhtmlcell function of tcpdf, it is not going to outcome as pdf. it crashed all the time and shows white page instead.
Tried lots of way but didn't work any.
Please suggest any solution if it is there.
Any help will truly be appreciated.
Regards,
Jenish

Solve the problem by installing XCACHE, It really speeds up the operation.
or,
You can also use MPDF, give it a try.

Related

Joomla content to pdf

Hi I'm trying to convert a joomla page into pdf so far the things I tried keep failing or fell short. I tried PhocaPDF but I get tons of errors upon install and It would require me to change the jore of joomla. also tried Root pdf content problem is I have some php codes in the articles that would output too. So I'm only left with hard coding it. Would anyone help me on how should I approach this? Should I use PHP on my articles or Javascript? Thanks.
you can try to use following extension
http://forum.joomla.org/viewtopic.php?f=624&t=808593

Using PHP and SQL to generate Excel files with statistical graphs and piecharts?

I got a database with a lot of number statistical related info, which i'm looking to generate out in an excel file.
So first of all of all, do anyone of you have experience with any popular libraries/scripts to generate excel files?
Secondly, im thinking it would be cool to display some of these very dull and boring numbers, in pie charts and graphs. Again, do anyone of you have experience with any popular libraries/scripts to generate such things inside an excel file?
Thanks a lot!
Try PHPExcel library - http://phpexcel.codeplex.com/
It satisfied all my needs, including the ones you specified, but not limited to only them.
Might need to increase memory limit a bit though since in large data cases as the one you specified it consumes a significant amount of memory.
I can second the PHPExcel library, I have used it a couple of times in the past and it works great. Unfortunately you cannot create charts with it as far as I remember. Someone else brought up this question before, maybe you will find something helpful here
Create Excel chart programmatically in PHP

php mosaic script

I'm using a script that I downloaded from google code to dynamically generate mosaic images with the GD library. The script seems a bit convoluted. I've messed around with it quite a bit, but I'm sort of confused since it's written in German and I don't speak deutsch. I know that in order for it to work, I need to have 121 different images. But, I'm not sure if they needs to be in the directory or in mysql. Does anyone have a clue as to how to use this? Or does anyone have some suggestions for a better script for generating mosaic images with the php GD library?
The script can be found here: http://code.google.com/p/phpmosaic/
Thanks,
Lance
The images you like to use as thumbnails have to be inside a directory. You must add them to the db using the methods
phpMosaicImageParser::parseImageFolder() or
phpMosaicImageParser::parseImage()
However: there is no fix number of required thumbnails, it will depend on the SourceImage and the used options how much thumbnails you'll need at least.

Fastest PDF generation in PHP?

I'm attempting to generate some reports dynamically, very simple HTML tables with borders.
I've tried TCPDF and it renders up to 400 rows just fine but anything more than that (about 20 pages) it can't handle it. DOMPDF can't even do that.
These reports can be thousands of rows.
Any idea on a faster library or a better plan of attack?
Try php-wkhtml2x php extension. It uses popular web engine webkit(Chrome and Safari uses that)
I use the FPDF library, the output is fast and resource-efficient. Try it out...
http://www.fpdf.org/
I don't know if these methods are the fastest, but they can certainly handle more than 20 pages.
You could use latex in combination with php:
http://www.linuxjournal.com/article/7870
or Zend_Service_LiveDocx_MailMerge
http://www.phphatesme.com/blog/webentwicklung/pdf-erzeugung-mit-dem-zend-framework/
Try DocRaptor.com. It's a web-based app that converts html to pdf. Easy to use.
It's possible that depending on the report that PHP is not the right solution you and might consider another alternative language such as perl to accomplish this. I have no experience with other server-side languages but it is something to keep in mind. Definitely follow #Pekka's advice and determine the limits and work on adjusting those.
Fact
Thousands of rows can be handled by the php.
My assumption
Most probably you will be fetching data from db and saving to an array and then you will be looping to write the rows.
This will eat memory.
My suggestion
Try to write into the pdf at time of fetching from db. remove the step of storing into an array.
check execution time and memory allocated in php ini.
At last when you generate it , think PDF can handle it or not :-)
surely It will have huge size .

Search through PDF files with PHP

I'm trying to find a way to search inside PDF files. I came accross the PHP PDF class but I can't seem to find any function for reading/searching a filestream.
So, as naive as I am, i tried to simple get a stream using file_get_contents(), obviously it's an encrypted-like output ;)
So my question, is there any way to search through PDF files? I'm looking for script-only / free / open source solutions and not buying some expensive commercial libraray.
XPDF?
There is a blog post here that may be of help.
There seems to be some code here that could help - a simple class that reads a PDF into plaintext. Unsure if it supports decryption.
There are also a number of resources in PHP documentation that may help you. Click.
FPDF and FPDI may also help. Probably your best bet after some research.**
A PHP search engine called Sphider has the option of adding PDF search via XPDF. You can then customise the result templates to fit in with the rest of your site (if applicable).

Categories