Home  |  Linux  | Mysql  | PHP  | XML
From:Paul M Foster Date:Thu Jul  2 14:08:10 2009
Subject:Re: Dom PDF Problem
On Thu, Jul 02, 2009 at 04:29:01PM +0530, Pravinc wrote:

> Hey all,
>
> I am working with generating PDF using Dom PDF.
>
> My problem is when I generate a single PDF , Its working fine.
>
> But when I code it in a loop for generating more than one PDF it gives some
> error.
>
> $DomObj = new DOMPDF();
>
> $DomObj->load_html_file($pth);
>
> $DomObj->render();
>
> $pdf = $DomObj->output();
>
> file_put_contents($MainDir."/Order-".$rsOrder[$ro]['OrderNumber']."/packing_
> slip.pdf", $pdf);
>
> the above code is in a loop
>
> I come to know that ,there is problem with memory leak.
>
> Also I thought that it was because I had not destroy the previously created
> Object.
>
> So I also tried destroying it using unset.. I don't know whether its
> destroying or not.
>
> Error is something like
>
> "Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No
> block-level parent found. Not good.' in
> D:\foldername\project\control\dompdf\include\inline_positioner.cls.php:68
> Stack trace: #0 D:\foldername\ project
> \control\dompdf\include\frame_decorator.cls.php(381):
> Inline_Positioner->position() #1 D:\foldername\ project
> \control\dompdf\include\inline_frame_reflower.cls.php(56):
> Frame_Decorator->position(".........
>
> Can anyone please give me some way to solve this.
>

I had an error something like this when using FPDF. It would hack up the
second PDF. I didn't investigate it a lot, but my solution was to
instantiate the class *once*, and loop on the *rest* of it.

Paul

--
Paul M. Foster
Navigate in group php.general at sever news.php.net
Previous Next


Your recent visits
RE: [PHP] removing an array from a compound array
Dom PDF Problem
cvs: peardoc / authors.xml /en/package/encryption/crypt-gpg examples.xml
Re: [PHP] generally, where in cPanel can one set the default page to load?
Re: [PHP] generally, where in cPanel can one set the default page to load?



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants