Home » File Formats » File_PDF » Bug #5228
PDF Error: Font has not been set
Details
| Submitted | 2005-08-29 10:01 UTC |
|---|---|
| From | d dot baechtold at unico dot ch |
| Assigned | yunosh |
| Status | No Feedback |
| Package | File_PDF |
| PHP Version | 5.0.4 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-08-29 10:01 UTC] d dot baechtold at unico dot ch
Description:
------------
My PDF contains two pages. If I add the second page manualy, it works. But if it is done by autoPageBreak, the error message "Font has not been set" occurs when I open the PDF document and reach the second page.
I solved this bug like this:
In _beginPage(), line 7, the var _font_family is set to ''. Why? I removed this line to enable the call to setFont()
Then, in setFont(), is the comment "If font requested is already the current font don't bother with the rest of the function, simply return.". This means that when one adds a new Page, and the font has to be set (and written to PDF!) again, it won't be written if it is still the same font. As far as I know now after several tests, it is necessarily to set the font after each new page. So I removed the part after this comment, to ensure setFont() will write the font into PDF file every time, even if it is the same font again.