Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.3

Bug #2682 problems with addPage and multiCell
Submitted: 2004-11-03 20:47 UTC
From: roberto at solary dot net Assigned: mdjukic
Status: Closed Package: File_PDF
PHP Version: 4.3.7 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 - 20 = ?

 
 [2004-11-03 20:47 UTC] roberto at solary dot net
Description: ------------ addPage doesn't set font for a new page. Reproduce code: --------------- $this->_font_family always is null and doesn't setFont for the new page. if ($this->_font_family) { $this->setFont($this->_font_family, $style, $this->_font_size_pt); } Expected result: ---------------- The entire file is written. Actual result: -------------- Only the first page is written.

Comments

 [2004-11-05 23:36 UTC] keng at dis-corp dot com
I made a couple of changes to get this working for me. Below are the changes... function _beginPage(...) { : : //$this->_font_family = ''; //Keng - Don't want to reset this information. : : } setFont(...) { : : /* Need to let the font information be written out each time, so when we do go to a new page, we have the font information. if ($this->_font_family == $family && $this->_font_style == $style && $this->_font_size_pt == $size) { return; } */ : : } Hope this helps.
 [2004-11-06 15:02 UTC] roberto at solary dot net
Thks, but what happend with it's autobreak? I made this in addPage function: # Here _font_family isset $family = $this->_font_family; . . . if ($family) { $this->setFont($family, $style, $this->_font_size_pt); }
 [2004-11-08 15:21 UTC] keng at dis-corp dot com
What do you mean about the autobreak? Autobreak works for me, but I had to make sure that I commented out the information in the setFont() function. This is what I was doing: $text = file_get_contents("test.txt"); $pdf = &File_PDF::factory('L', 'mm', 'Letter'); $pdf->open(); $pdf->setMargins("13", "13", "13"); $pdf->setAutoPageBreak(true, "13"); $pdf->SetFont('Courier','',9); $pdf->AddPage(); //$pdf->SetFont('Courier','',9); //Before the fix I proposed, you had to set this just after setting the page. Couldn't do it before since, AddPage() clears _font_family variable in beginDoc(). $pdf->Write(4, $text); $pdf->Output('test.pdf', true); What I found is that you have to set the font after doing an AddPage() call. If you do it before, it just doesn't work right. The reason for this is beginDoc() is clearing the _font_family variable in beginDoc(). With the changes I have done, you should be able to add the setFont() before the addPage() and things should work. Hope this helps.
 [2004-11-08 15:24 UTC] keng at dis-corp dot com
Sorry about that, beginDoc should be _beginPage().
 [2004-12-05 11:43 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-05-26 23:33 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!