|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with File_PDF
Hello,
I'm using the "File_PDF" and everything works fine. There are problems when I'm having to many characters for 1 line. Everything is stored in a table, and after saving the pdf will be created. Example code: $pdf->text(10, 45, "data"); This will show, at line 45 position 10 the word data. This works fine. But suppose "data" would be a text block of over 150 characters. Then I should be able to put a <br> or a \n at some (logical) place. How can I do this? Ok, I can write some code but then I have for example d as the last word on line 1 and line 2 starts with ata. In this case, the word data should must appear completely on the second line. Martine |
|
#2
|
|||
|
|||
|
You could e.g. use multiCell() for automatic line breaks or write() which accepts the usage of "\n" in the given text.
http://pear.php.net/package/File_PDF/docs/latest/apidoc/File_PDF/File_PDF.html#methodmultiCell http://pear.php.net/package/File_PDF/docs/latest/apidoc/File_PDF/File_PDF.html#methodwrite |
|
#3
|
|||
|
|||
|
Thanks for helping.
I'll use function MultiCell, but do you also have an example of this? I really don't know how to implement it in my code. How can I say on which line, which position, ... Grtz, Martine |
|
#4
|
|||
|
|||
|
You have to call setXY() before multiCell() if you're not yet at the right position:
http://pear.php.net/package/File_PDF/docs/latest/apidoc/File_PDF/File_PDF.html#methodsetXY |
|
#5
|
|||
|
|||
|
Everything's working fine now!
Thanks a lot! |
|
#6
|
|||
|
|||
|
Hello
I'm having some problem with File_PDF as well.. and with line breaks. I've use both the write() and multiCell() methods, but either will return line breaks with the \n new line characters as stated in the documentation. When I run the following code.... PHP Code:
I get this output: http://www. uno-code .com/files/snap.gif <- please remove spaces in the domain (I'm unable to post URLs at this point). I also tried the multiCell method PHP Code:
And the \n will always display in the PDF and no line break occurs. I'm currently using the following version: PEAR-File_PDF-0.3.1 Any ideas? Thanks! hanji |
|
#7
|
|||
|
|||
|
'\n' is not the same as "\n" (and you're looking for the latter one).
|
|
#8
|
|||
|
|||
|
Quote:
Ah.. thanks! hanji |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Problem with File_PDF |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|