Re: [PHP] pdf

2006-06-29 Thread Jyry Kuukkanen

Hello


On Thu, 29 Jun 2006, weetat wrote:

 Hi all ,
 
   I am using PHP 4.3.2 and MYSQL database.
 
   I need to convert the sql query to Adobe PDF format.
   Any one have any suggestion how to do this?


I have used fpdf (http://www.fpdf.org/) in order to create PDF documents 
with PHP and it has worked fine for me.


Cheers,
--jq




   I have search phpclasses , found SQL2PdfReport classes , however it 
 gave error message as shown below :
 
Error in opening pdf 
 
 Lookup the code in the SQL2Report class , it did not support pdf 7.0 and 
 above.
 
 Thanks
 
 

-- 
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] Removing key and value

2006-05-04 Thread Jyry Kuukkanen
On Thu, 4 May 2006, Jonas Rosling wrote:

 How's the best way to remove a key and it's value from an array? Like in the
 code bellow where I would like to remove AK and it's value.
 
 $salesperson = array(
 'AK' = '1000',
 'AT' = '1500',
 'BT' = '2000'
);


unset($salesperson['AK']);


See http://www.php.net/unset for more.


Cheers,
-- 
--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] PHP-Jabber

2006-05-03 Thread Jyry Kuukkanen


Hello


On Wed, 3 May 2006, Tony Aldrich wrote:

 Can somebody recommend clean php jabber library? I must send notifications
 to some users.



This lib weems to work:

http://cjphp.netflint.net/

require(class.jabber.php);

$jabber = new Jabber;

$jabber-server = jabber.org;
$jabber-port   = 5222;
$jabber-username   = user;
$jabber-password   = passwd;
$jabber-resource   = ClassJabberPHP;

$jabber-Connect() or die(Couldn't connect!);
$jabber-SendAuth() or die(Couldn't authenticate!);
$jabber-SendPresence();
$jabber-SendMessage('[EMAIL PROTECTED]', 'normal', NULL, array('body' = 
'Hello');
$jabber-Disconnect();


-- 
--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] variable hell

2005-01-04 Thread Jyry Kuukkanen
On Tue, 4 Jan 2005, mario wrote:

 Hi all
 
 I have few variables in this format:
 
 $isproductssorttext = 150;
 $isofferssorttext = 250;
 $isnewproductssorttext = 350;
 
 $isproductscount = 50;
 $isofferscount = 30;
 $isnewproductscount = 20;
 etc
 
 
 What I want to do is have a variable
 e.g. $x = products;
 
 and create from that, the variable $is'products'sorttext
 (--$isproductssorttext) and use its value
 
 so if $x was offers on echo I would have (250) -- $isofferssorttext
 if $x was newproducts on echo I would have (350) -- 
 $isnewproductssorttext



Hello


I believe what you are after is ${'is'.$x.'sorttext'}

but I would rather use the nfollowing approach as it is much more readable 
and easier to debug:

$issorttext = array('offers' = 250, 'newproducts' = 250, ...)

and then use it:

echo $issorttext['offers'];




-- 
Cheers,
--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] PHP Accelerator

2004-11-06 Thread Jyry Kuukkanen
On Sun, 7 Nov 2004, raditha dissanayake wrote:

 David wrote:
 
  I need a PHP accelerator but am not sure which one to use. I would 
  highly prefer to not use a commercial accelerator and need one that 
  works with PHP 5. Does anyone recommend one out of the ones that exist?
 
 this one:
 
  - Turck MMCache for PHP


I second that, unless you need it with latest PHP4.3.x, that Turck MMCache 
does not support currently. Then the free option known to work is 
PHP-Accelerator.

-- 
--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] Presence of a program (PHP)

2004-03-16 Thread Jyry Kuukkanen
On Tue, 16 Mar 2004, Brent Clark wrote:

 I have to make use of embedded pdf files in my page (management decision, please 
 dont argue with me on this one, not my choice).
 I there a function or somthing to detect the presence of adobe reader to make sure 
 the client has it installed, before
 continuing with displaying it in the browser.
 I was thinking of trying to do a find the adobe.exe file, but I dont think that to 
 smart solution.

Hello

I understand you are planning to display a PDF file inside a browser, yes?

I believe it would be a security major risk if a server side script was 
able to list available applications on the client side. This may be 
possible with M$-script technology, but I would be very worried if it was 
possible with PHP. Please correct me if I talk nonsense...

Maybe a link to Adobe's Acrobat Reader download page is your best bet.


-- 
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

2004-02-19 Thread Jyry Kuukkanen
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

2004-02-18 Thread Jyry Kuukkanen
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] PDFlib error 2516

2004-01-16 Thread Jyry Kuukkanen
On Thu, 15 Jan 2004, Mark Wouters wrote:

 Hello!
 
 Tried out this simple script from a tutorial on creating PDF with PHP:
 
 ?php
 
  $pdf = PDF_new();
  PDF_open_file($pdf, testpdf.pdf);
 
   PDF_set_info($pdf, Author, Someone);
   PDF_set_info($pdf, Title, PDF creation with PHP);
   PDF_set_info($pdf, Creator, Someone);
   PDF_set_info($pdf, Subject, Creating PDFs);
 
   PDF_begin_page($pdf, 595, 842);
 
$arial = PDF_findfont($pdf, Arial, host, 1);
PDF_setfont($pdf, $arial, 14);
 
PDF_show_xy($pdf, Pricelist, 40, 780);
 
   PDF_end_page($pdf);
 
  PDF_close($pdf);
 
 ?
 
 However got this error:
 
 Fatal error: PDFlib error: [2516] PDF_findfont: Metrics data for font
 'Arial' not found in
 /usr/local/psa/home/vhosts/resilion.be/httpdocs/test/createpdf.php on line
 23
 
 Does anyone have an idea what the problem could be? What does the host
 mean in the example above ($arial = PDF_findfont($pdf, Arial, host,
 1); )?
 
 Thanks for any help
 
 Mark.


Hello

It very much looks like you are running your script under Un*x.
That is why Arial font is not found when using host setting. You 
should use Helvetica instead. The host refers to font selection 
available to PDFlib.
I tried a year or so ago setting up PDFlib so that I could use other than 
host with no luck. As I did not need more than those three basic fonts, 
I spent no more time sorting out the other options.

Take a look at sopdf.php that you can found from dataxi.sourceforge.net, 
and download latest solib-ver.tar.gz that contains the script. It is a 
fully functional class to produce PDF using PDFlib.


Cheers,

-- 
--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] Generating PDF

2003-12-31 Thread Jyry Kuukkanen


The code looks pritty much fine to me.

Have you tested your piece of code with PHP 4.x?

--jq


On Wed, 31 Dec 2003, Yann Larrivee wrote:

 Hi i am trying to generate a PDF with PHP5 (latest cvs) and PDFLib 5.0.2
 
 I have this very basic example that i took from php.net and saw the same
 code on http://www.sitepoint.com/article/1225/1
 
 ?php
 $pdf = pdf_new();
 pdf_open_file($pdf, philosophy.pdf);
 pdf_begin_page($pdf, 595, 842);
 $arial = pdf_findfont($pdf, Arial, host, 1); 
 pdf_setfont($pdf, $arial, 10);
 pdf_show_xy($pdf, There are more things in heaven and earth, Horatio,,
 50, 750); 
 pdf_end_page($pdf);
 pdf_close($pdf);
 ?
 
 But the function pdf_begin_page always return this error messsage.
 
 
 Fatal error: PDFlib error [2100] PDF_begin_page: Function must not be
 called in 'object' scope in
 /home/yann/public_html/test/pdf/OrderPdf.class on line 4
 
 
 To me this example seems right, and the function calls seems alright
 according to the docummentation.
 
 
 Anybody else have seen this probleme befor ?
 
 
 Thanks
 
 Yann
 
 

-- 
--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] PRINT QUESTION

2003-11-25 Thread Jyry Kuukkanen
On Tue, 25 Nov 2003, Burhan Khalid wrote:

 Dale Hersh wrote:
  I know that in php there are a bunch of basic functions for opening a
  connection to a printer and then handling the printer queue and so forth. I
  would like to know how to take a string and echo that to the printer in php.
 
 The printer functions only work under Windows. From 
 http://www.php.net/printer :
 
 These functions are only available under Windows 9.x, ME, NT4 and 2000.
 
 So if you are on windows, you can try running the printer_write() 
 example ( http://www.php.net/printer-write )
 
 If you are not on Windows, one way you can print is to try some output 
 redirection and see what kind of results you get, eg :
 
 system(cat file.txt  lpt1);
 
 were lpt1 is where your printer is connected. If your printer is 
 connected directly to the computer, it is on lp1 (usually, lpt1 is the 
 default printer port (parallel)). I think lpt1 stands for line printer 
 terminal 1, but I'm not too sure about that.  There are probably better 
 ways to do the same on other systems, but this is the quick example I 
 could think of.



Hello,

I have printed plenty and regularly under Linux through CUPS by issuing:

exec(lpr -Pprinter_name file_to_print)

or

$ph = popen(lpr -Pprinter_name);
fwrite($ph, $data_to_print);
pclose($ph);


If you need fancy printout, it might be a good idea to produce PDF that is 
printed out, then. If this is what you want, take a look at 
http://dataxi.sourceforge.net and download solib-version.tar.gz that 
contains sopdf.php -- or dataxi-version.tar.gz for higher level PDF 
classes. You need www.pdflib.com (free lite version available) in order 
to use sopdf.php or it's derivants.

Cheers,

-- 
--Jyry
:-(C:-/C8-OC8-/C:-(

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Betr: [PHP] php - printer button

2003-07-01 Thread Jyry Kuukkanen
On Tue, 1 Jul 2003 [EMAIL PROTECTED] wrote:

 
 On Tue, 1 Jul 2003, Dore van Hoorn wrote:
 
  This is not exactly what you've asked for, but perhaps you're able to use
  it anyway. It is the PHP script I use to create a print-friendly page:
  Everything between !-- Start Print Version -- and !-- End Print Version
 
 thanks friend..
 exactly I wish print my data transaction to paper via printer driver  
 and this cliet running ms windows (printer this here)
 and server running redhat linux (PHP on apache web server this here)

http://dataxi.sourceforge.net

Download dataxi-install-xxx.tar.gz.
That inludes a package called dzdocprint.php that produces PDF that you 
can pass to CUPS printer on the server side (lpr -Pprintername tmp.pdf).

If you download the example-xxx.tar.gz you find a file called 
print_album.ini that is an example template for printing used by 
dzdocprint.php.

Let me know if you have any troubles getting started with it.

Cheers,
-- 
--Jyry
:-(C:-/C8-OC8-/C:-(


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MSSQL using Sybase FreeTDS

2003-04-03 Thread Jyry Kuukkanen
On Thu, 3 Apr 2003, Craig wrote:

 Hey all,
 
 Im hoping someone can shed some light on this for me:
 
 Im running PHP 4.31 on RH Advanced Server 2.1
 
 I am connecting, to M$SQL Server 2000  using FreeTDS -- with Sybase support,
 and Im stumped on 1 thing:
 
 CODE:
 
 
 ?php
 
 $ccode = $_POST['ccode'];
 $cname = $_POST['cname'];
 $cstreet = $_POST['cstreet'];
 
 include(includes/connect.php);
 $iqry_clients = mssql_query(INSERT INTO Clients
 (client_code,client_name,client_street) VALUES
 ('$ccode','$cname','$cstreet'));
 
 mssql_close($conn);
 
 ?
 
 
 
 The above code works fine, except when one of the fields e.g client_name -
 Has a quoted string or an apostrophe in it, it just spews the following
 error:
 
 Warning: Sybase error: Line 1: Incorrect syntax near 's'. (severity 15) in
 /var/www/html/clients/pages/add_client.php on line 17
 
 Has anyone experienced this, and if so know of a possible solution?? I have
 used addslashes() etc but still no joy.
 
 Thanks in advance.
 
 Craig

I think you should pass the values through AddSlashes function:

include(includes/connect.php);
$ccode = AddSlashes($ccode);
$cname = AddSlashes($cname);
$cstreet = AddSlashes($cstreet);
$iqry_clients = mssql_query(INSERT INTO Clients
(client_code,client_name,client_street) VALUES
('$ccode','$cname','$cstreet'));



Cheers,
-- 
--Jyry
:-(C:-/C8-OC8-/C:-(


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php