Re: [PHP] PDF - Coords
On Thu, 19 Feb 2004, Juan Torres wrote: ¡Hola! Excuse me, but my english is bad :(. My problem is: When I'm writting text in a PDF document, I want to know the current position, or next position of next text to insert. I want to know when I'm near the finish page. ¡Hola! There is no need nor a reason to find out current position using PDF functions. If you are outputting lines after lines, you need to keep track of the y-position by yourself. The following simple and ugly piece of code should demostrate the logic: define(MAX_Y_POS, 300); define(ROW_HEIGHT, 4); $y_pos = 0; foreach ($many_rows as $row) { if ($y_pos MAX_Y_POS) { makePageChange(); $y_pos = 0; }; // if $y_pos += ROW_HEIGHT; printRow($row); }; // foreach If you use pdflib, you might want to take a look at sopdf.php - it's available from dataxi.sourceforge.net. Get the latest version of solib.tar.gz - that includes sopdf.php PD: Do you know Spain or spanish language? ;) ¡Si! Estudio español - este es segundo año, bastante listo :-) Ahora leo un libro de Montalbán, de Pepe Carvalho :-))) -- Regards, --Jyry C|:-(C|:-/C|8-OC|8-/C|:-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF - Coords
Thanks very much! You are very nice. If you want to practise your spanish, you can write me when you want. Muchos saludos desde España. Hasta pronto. Juan Torres. Jyry Kuukkanen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 19 Feb 2004, Juan Torres wrote: ¡Hola! Excuse me, but my english is bad :(. My problem is: When I'm writting text in a PDF document, I want to know the current position, or next position of next text to insert. I want to know when I'm near the finish page. ¡Hola! There is no need nor a reason to find out current position using PDF functions. If you are outputting lines after lines, you need to keep track of the y-position by yourself. The following simple and ugly piece of code should demostrate the logic: define(MAX_Y_POS, 300); define(ROW_HEIGHT, 4); $y_pos = 0; foreach ($many_rows as $row) { if ($y_pos MAX_Y_POS) { makePageChange(); $y_pos = 0; }; // if $y_pos += ROW_HEIGHT; printRow($row); }; // foreach If you use pdflib, you might want to take a look at sopdf.php - it's available from dataxi.sourceforge.net. Get the latest version of solib.tar.gz - that includes sopdf.php PD: Do you know Spain or spanish language? ;) ¡Si! Estudio español - este es segundo año, bastante listo :-) Ahora leo un libro de Montalbán, de Pepe Carvalho :-))) -- Regards, --Jyry C|:-(C|:-/C|8-OC|8-/C|:-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDF - Coords
[snip] How can I know the currents coordenades of my pdf document? [/snip] Use a GPS? http://catb.org/~esr/faqs/smart-questions.html HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDF - Coords
On Wed, 18 Feb 2004, Jay Blanchard wrote: [snip] How can I know the currents coordenades of my pdf document? [/snip] Use a GPS? http://catb.org/~esr/faqs/smart-questions.html HTH! ¹Hola! Maybe Señor Torres wanted to know the current position of drawing text or an image, that is not really possible - as far as I know - in producing PDF document. Juan, could you specify the actual problem you are facing? That might lead you to get the answer for your question. -- Hienoja terveisiä --Jyry C|:-(C|:-/C|8-OC|8-/C|:-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF - Coords
¡Hola! Excuse me, but my english is bad :(. My problem is: When I'm writting text in a PDF document, I want to know the current position, or next position of next text to insert. I want to know when I'm near the finish page. I hope that you can help me. Thank you! Juan Torres. PD: Do you know Spain or spanish language? ;) ¹Hola! Maybe Señor Torres wanted to know the current position of drawing text or an image, that is not really possible - as far as I know - in producing PDF document. Juan, could you specify the actual problem you are facing? That might lead you to get the answer for your question. -- Hienoja terveisiä --Jyry C|:-(C|:-/C|8-OC|8-/C|:-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php