[PHP] fpdf problem?
I've been using fpdf to create pdf files for my site. All has been well for over a year. Suddenly I have a problem wherein IE 10 on W7 crashes when I try to print one of these pdfs created by my php scripts. The pdf files that I create seem fine. If I bring one up in IE and then save it to my drive, I can then exit IE and go open the pdf and print it just fine. I have removed my pdf printer drivers from my system and that hasn't improved my situation. No luck there. The exact scenario is: - script generates pdf and opens it in a new target window; - user clicks on print toolbar icon or File,Print; - print dialog opens; here I see some problems in that the (very complex) dialog is not displaying correctly with controls misaligned or overlaying other controls; - click on Ok to execute the print to printer and nothing happens; wait 5 minutes and still nothing; - NOW the problems begin; when the window with the pdf in it is closed, in about 2 seconds I get a dialog box telling me IE has stopped working. Note that the problem only occurs when I attempt to print. If my script opens the pdf target window and I simply close it - no problems occur. BUT - if I actually open a print dialog I get a crash whether I click OK or Cancel, as soon as I close the window containing the pdf. My question is does anyone have problems with fpdf lately? Since my files seem to be completely normal to adobe reader I don't think their content is at fault. It seems more like IE is not handling them and I can't find anything online about this. I'm really hoping this is a problem wtih fpdf rather than IE since solutions are more apt to come out of this forum than the great wizards of M$ Oz. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf problem?
On Aug 9, 2013, at 10:50 AM, Jim Giner jim.gi...@albanyhandball.com wrote: I've been using fpdf to create pdf files for my site. All has been well for over a year. Suddenly I have a problem wherein IE 10 on W7 crashes when I try to print one of these pdfs created by my php scripts. The pdf files that I create seem fine. If I bring one up in IE and then save it to my drive, I can then exit IE and go open the pdf and print it just fine. I have removed my pdf printer drivers from my system and that hasn't improved my situation. No luck there. The exact scenario is: - script generates pdf and opens it in a new target window; - user clicks on print toolbar icon or File,Print; - print dialog opens; here I see some problems in that the (very complex) dialog is not displaying correctly with controls misaligned or overlaying other controls; - click on Ok to execute the print to printer and nothing happens; wait 5 minutes and still nothing; - NOW the problems begin; when the window with the pdf in it is closed, in about 2 seconds I get a dialog box telling me IE has stopped working. Note that the problem only occurs when I attempt to print. If my script opens the pdf target window and I simply close it - no problems occur. BUT - if I actually open a print dialog I get a crash whether I click OK or Cancel, as soon as I close the window containing the pdf. My question is does anyone have problems with fpdf lately? Since my files seem to be completely normal to adobe reader I don't think their content is at fault. It seems more like IE is not handling them and I can't find anything online about this. I'm really hoping this is a problem wtih fpdf rather than IE since solutions are more apt to come out of this forum than the great wizards of M$ Oz. Does this happen only for pdfs you've generated with fpdf, or any pdf file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf problem?
On 8/9/2013 12:06 PM, Tamara Temple wrote: On Aug 9, 2013, at 10:50 AM, Jim Giner jim.gi...@albanyhandball.com wrote: I've been using fpdf to create pdf files for my site. All has been well for over a year. Suddenly I have a problem wherein IE 10 on W7 crashes when I try to print one of these pdfs created by my php scripts. The pdf files that I create seem fine. If I bring one up in IE and then save it to my drive, I can then exit IE and go open the pdf and print it just fine. I have removed my pdf printer drivers from my system and that hasn't improved my situation. No luck there. The exact scenario is: - script generates pdf and opens it in a new target window; - user clicks on print toolbar icon or File,Print; - print dialog opens; here I see some problems in that the (very complex) dialog is not displaying correctly with controls misaligned or overlaying other controls; - click on Ok to execute the print to printer and nothing happens; wait 5 minutes and still nothing; - NOW the problems begin; when the window with the pdf in it is closed, in about 2 seconds I get a dialog box telling me IE has stopped working. Note that the problem only occurs when I attempt to print. If my script opens the pdf target window and I simply close it - no problems occur. BUT - if I actually open a print dialog I get a crash whether I click OK or Cancel, as soon as I close the window containing the pdf. My question is does anyone have problems with fpdf lately? Since my files seem to be completely normal to adobe reader I don't think their content is at fault. It seems more like IE is not handling them and I can't find anything online about this. I'm really hoping this is a problem wtih fpdf rather than IE since solutions are more apt to come out of this forum than the great wizards of M$ Oz. Does this happen only for pdfs you've generated with fpdf, or any pdf file? Good question and the answer is: it happens for other pdfs as well, so I guess it's not fpdf. Sorry for the mis-post here - I'll do more research on Adobe and IE. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf problem?
On 8/9/2013 12:11 PM, Jim Giner wrote: On 8/9/2013 12:06 PM, Tamara Temple wrote: On Aug 9, 2013, at 10:50 AM, Jim Giner jim.gi...@albanyhandball.com wrote: I've been using fpdf to create pdf files for my site. All has been well for over a year. Suddenly I have a problem wherein IE 10 on W7 crashes when I try to print one of these pdfs created by my php scripts. The pdf files that I create seem fine. If I bring one up in IE and then save it to my drive, I can then exit IE and go open the pdf and print it just fine. I have removed my pdf printer drivers from my system and that hasn't improved my situation. No luck there. The exact scenario is: - script generates pdf and opens it in a new target window; - user clicks on print toolbar icon or File,Print; - print dialog opens; here I see some problems in that the (very complex) dialog is not displaying correctly with controls misaligned or overlaying other controls; - click on Ok to execute the print to printer and nothing happens; wait 5 minutes and still nothing; - NOW the problems begin; when the window with the pdf in it is closed, in about 2 seconds I get a dialog box telling me IE has stopped working. Note that the problem only occurs when I attempt to print. If my script opens the pdf target window and I simply close it - no problems occur. BUT - if I actually open a print dialog I get a crash whether I click OK or Cancel, as soon as I close the window containing the pdf. My question is does anyone have problems with fpdf lately? Since my files seem to be completely normal to adobe reader I don't think their content is at fault. It seems more like IE is not handling them and I can't find anything online about this. I'm really hoping this is a problem wtih fpdf rather than IE since solutions are more apt to come out of this forum than the great wizards of M$ Oz. Does this happen only for pdfs you've generated with fpdf, or any pdf file? Good question and the answer is: it happens for other pdfs as well, so I guess it's not fpdf. Sorry for the mis-post here - I'll do more research on Adobe and IE. Update: Solved my print problem by unchecking an option in Adobe Reader - Display PDF in browser. Solved my garbled dialog box and the printing of the document. Of course - the down side is that you must close the document and then the now-empty browser window. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf problem?
Jim Giner in php.general (Fri, 09 Aug 2013 12:33:30 -0400): Good question and the answer is: it happens for other pdfs as well, so I guess it's not fpdf. Sorry for the mis-post here - I'll do more research on Adobe and IE. Update: Solved my print problem by unchecking an option in Adobe Reader - Display PDF in browser. Solved my garbled dialog box and the printing of the document. Although it is off-topic: I do not have this problem with PDFs in a IE10 browser window. No garbled print dialogue, prints OK, no crash. IE 10.0.9200.16635, Update version 10.0.7, W7 Pro 64-bits. Adobe Reader XI, version 11.0.3. Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf problem?
On 8/9/2013 1:56 PM, Jan Ehrhardt wrote: Jim Giner in php.general (Fri, 09 Aug 2013 12:33:30 -0400): Good question and the answer is: it happens for other pdfs as well, so I guess it's not fpdf. Sorry for the mis-post here - I'll do more research on Adobe and IE. Update: Solved my print problem by unchecking an option in Adobe Reader - Display PDF in browser. Solved my garbled dialog box and the printing of the document. Although it is off-topic: I do not have this problem with PDFs in a IE10 browser window. No garbled print dialogue, prints OK, no crash. IE 10.0.9200.16635, Update version 10.0.7, W7 Pro 64-bits. Adobe Reader XI, version 11.0.3. Jan I have since my last post discovered that XI does indeed solve the problem completely. Too bad M$ doesn't post that info on all the many forum topics complaining about this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF ?
I never found a solution to this myself. On Apr 26, 2012, at 2:13 PM, Jim Giner wrote: For those of you with FPDF experience. I've just begun using it and have figured out how it works I think. I am still having trouble with the bottom of the page tho. Seems that if I get too close to the bottom margin and my data line exceeds the amount of available space, my MultiCell elements print some of their contents and then my Footer gets printed and then I go to a new page where some small amount of the remaining data for that line gets printed and then a new page is output and repeat. This can go on for 3-4 pages before things work out and my report continues until it gets a full page again and then it all happens again. I know it sounds complicated, but I'm hoping someone else has experienced this kind of learning curve and can give me a clue as to what I'm doing wrong, or at least what's happening. Even better would be an algorithm for detecting how much space I have left so I can avoid these split lines and perhaps solve my entire problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF ?
For those of you with FPDF experience. I've just begun using it and have figured out how it works I think. I am still having trouble with the bottom of the page tho. Seems that if I get too close to the bottom margin and my data line exceeds the amount of available space, my MultiCell elements print some of their contents and then my Footer gets printed and then I go to a new page where some small amount of the remaining data for that line gets printed and then a new page is output and repeat. This can go on for 3-4 pages before things work out and my report continues until it gets a full page again and then it all happens again. I know it sounds complicated, but I'm hoping someone else has experienced this kind of learning curve and can give me a clue as to what I'm doing wrong, or at least what's happening. Even better would be an algorithm for detecting how much space I have left so I can avoid these split lines and perhaps solve my entire problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF passing values into header and footer?
- Original Message - From: Angus Mann angusm...@pobox.com To: php-general php-general@lists.php.net Sent: Monday, April 26, 2010 2:46 PM Subject: [PHP] FPDF passing values into header and footer? Hi all. Whilst this question relates to fpdf (www.fpdf.org) I think it really is a PHP question, because it involves passing values into classes and functions. Here's the problem .. I need to pass a PHP variable like $number into the header of a PDF. I have extended the FPDF class as follows class PDF extends FPDF{ function Header(){ $this-SetFont('Arial','BU',12); $this-Cell(0,5,'User notes for invoice number '.$number,0,'1','L'); } } I hate it when I ask a question prematurely, because I could have figured it out myself. Getter and Setter functions are the answer. function setNumber($number){ $this-number = $number; } $pdf-setNumber('12345'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF passing values into header and footer?
Hi all. Whilst this question relates to fpdf (www.fpdf.org) I think it really is a PHP question, because it involves passing values into classes and functions. Here's the problem .. I need to pass a PHP variable like $number into the header of a PDF. I have extended the FPDF class as follows class PDF extends FPDF{ function Header(){ $this-SetFont('Arial','BU',12); $this-Cell(0,5,'User notes for invoice number '.$number,0,'1','L'); } } The problem is, I can't figure out how to pass a value from the rest of the PHP script so it can be seen within the function above. I'm sure the problem is one of the scope of the variable but this sort of thing is new to me and I can't figure out the syntax to make it work. Before anybody suggests something like ... function Header($number){} Please recognize that the Header function is called automatically by FPDF and not by my code, so unless I totally hack the FPDF class I can't do this easily. Any suggestions please?
[PHP] fpdf adding font error
Hello gang, I know this is not an fpdf mailing list but if anyone has experience on the matter please help. I am working on a pdf generation part of a project and I am using fpdf to generate them. The content of the pdf needs to be in greek. But I am having difficulties to get the pdf generated properly. This means that I can't see the greek in the pdf file that is generated. I have tried to set the encoding to non-UTF since fpdf doesn't support UTF-8 but the problem still remains. As a second solution I am trying to add new fonts with the ISO-8859-7 encoding but it doesn't work as expected. The font is not being although I am following the fpdf's directions step-by-step. Does anybody know another way to generate pdf files with greek properly or can help me with the fpdf?? Thanks in advance. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF Printing Ideas?
Hello all, I'm looking for some suggestions. I'm writing a new application that generates PDF's on the fly with FPDF. Basically I have a search page where you can search for customer records. Once your search has returned the records you can then click on a link which will send the record_id to the page that generates the PDF. And while this brings up the PDF and I can click on the printer icon to print the document, I want to be able to select multiple documents to print at one time. Example: [ ] 12345 [ ] 12346 [ ] 12347 [ ] 12348 [ ] 12349 [ ] 12350 I want to select the first and last record to be printed, so I was thinking I could od several things here. Since the Output() of FPDF cannot be sent directly to a printer I was going to 1) When someone clicks a checkbox, use the javascript onChange action to generate and save the PDF in the background. So, when someone clicks a checkbox, the page that generates my PDF would run without the user seeing it...this page would save the PDF to a folder on the server and once all checked items are selected the user will simply click on a Print Selection link which will point to a PHP page that just says to print *.pdf from that folder. 2) Allow the user to check all the documents they want to print and then when the Print Selection link is clicked, pass all of the checkbox values via $_POST to a new page which will run a loop that generates, prints and deletes the files. Does anyone have any experience or any better ideas to accomplish a selective multiple document print for documents that don't initially exist? Thanks, Dan
Re: [PHP] FPDF Printing Ideas?
Just generate a much larger PDF with all the pages they asked for and call it done. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF Printing Ideas?
On Tue, Dec 16, 2008 at 2:32 PM, c...@l-i-e.com wrote: Just generate a much larger PDF with all the pages they asked for and call it done. :-) I don't think I can do it that way unfortunately. They will be printing 100-300 records in bulk...the amount of time it would take to generate one giant PDF file for all of the records would probably be insane and definitely much longer than the users are willing to wait. And also I don't believe you can loop the FPDF functions without it throwing an error.
Re: [PHP] FPDF
On Jan 18, 2008, at 1014AM, Balasubramanyam Ananthamurthy wrote: I'm fetching content from database and printing it on the browser. I want add an link on the same page Click here to view it in PDF. Is it possible to do it using FPDF? If yes, how can I do this? Yes, this can be done with FPDF. Go to http://fpdf.org, click on scripts and you'll find multiple examples with MySQL, one with PostgreSQL and even one with MS Access. FPDF has pretty good documentation and lots of example code to browse. I suggest using the forum on fpdf.org to ask specific questions as you'll likely get better help there than on this list, simply because it's focused specifically on fpdf. Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF
Hello, I'm fetching content from database and printing it on the browser. I want add an link on the same page Click here to view it in PDF. Is it possible to do it using FPDF? If yes, how can I do this? Thank you. Balu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF
On Fri, January 18, 2008 12:14 pm, Balasubramanyam Ananthamurthy wrote: I'm fetching content from database and printing it on the browser. I want add an link on the same page Click here to view it in PDF. Is it possible to do it using FPDF? If yes, how can I do this? Actually, FPDF goes even further than that, and (sort of) lets you overlay a FORM on top of a PDF -- which is probably overkill for what you need. There are several options for generating a PDF from your DB data, actually, but this one was worked well for me for a long time: http://php.net/pdf Note that this has a kind of funky license setup for commercial/non-commercial usage, so you may not find that appropriate for your needs though. In addition to the php.net examples, here is a web-based calendar that you can also print out and put on your fridge: http://uncommonground.com/events.htm http://uncommonground.com/events.pdf That would be useless to you without source: http://uncommonground.com/events.phps http://uncommonground.com/events_pdf.phps A bit messy code, and a lot of layout stuff you don't need, but it is a real-live working example :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fpdf
Yes you can... $pdf-Output(thelocation/filename.pdf, F); Just make sure that thelocation has permission to write for the web server. /Peter -Original Message- From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED] Sent: Thursday, July 27, 2006 7:05 AM To: php-general@lists.php.net Subject: [PHP] fpdf Hi everyone. Could someone tell me if fpdf class can write the pdf file into the server? I've reading about and just found that it save the pdf document in a local place or open it in browser. I need to write it in server, it's possible? Thanks a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF, HTML and PDML
Hi there I am trying out the PDML class which interfaces the FPDF code for generating PDF's with markup language. The issue its I cant put straight html tables into it. Is there such an interface to FPDF that can be used to convert html to pdf. I have tried alot of them and none worked out of the box. Let me know cheers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF output to a variable
Hi List, I have done some searching on Google and the Archives for what I am trying to do, but it seems I am searching up the wrong avenues. Here is my situation: I generate pdf files with fpdf (fpdf.org) and I would like to catch the output of the pdf stream into a variable so that I can attach it to an email. The email and attaching the file to the email is working great, but when I get the email adobe can not open the pdf. It seems that it is not being decoded properly. I attach another pdf that is in the file system already, but sense this one is created dynamically it is not saved anywhere. I just am trying to get the ouput in a variable instead of outputing it to the browser. Below is some code for the pdf and what I was trying to do to send it. The below code may have errors, I just typed it quickly in the email. The concept is there though. //Creating the pdf [create_pdf.php] ? require(FpdfProtection.class.php); // [http://www.cetusa.org/temp/fpdf_protection.phps] session_cache_limiter('private'); session_start(); header(Cache-Control: no-store, no-cache, must-revalidate); define('FPDF_FONTPATH','font/'); $pdf = new FPDF_Protection(); $pdf-Open(); $pdf-SetMargins(3,3); $pdf-AddPage(); $pdf-Cell(100,0,'This is the text to be put into the pdf.' ); $pdf-SetProtection(array('print'),'','87df9dfn43*%^uskaid'); $pdf-Close(); $pdf-Output(); exit(); ? ? //Get the output and send the email send_mail.php //uses the class MIME_mail (http://www.cetusa.org/temp/MIME.class.phps) //WARNING I know that this is not how it is intended to be used, //but this is the what I want to accomplish. $fp = fopen(create_pdf.php); $pdf = fpassthru($fp);//actually returns the number of characters read, I want the content of the executed path. fclose($fp); //END WARNING $from='[EMAIL PROTECTED]'; $to='[EMAIL PROTECTED]'; $subject='PDF FILE'; $message='Attached is the PDF file.'; $mail = new MIME_mail($from, $to, $subject,$message); $mail-attach($pdf, 'Profile', OCTET,BASE64,'attachment; filename=Profile.pdf'); $mail-send_mail(); ? Any help on this would be great. If you know of some search terms that would get me going in the right direction that would be great also (I don't mind doing the research). If you need more clarification please let me know. Regards, Justin Palmer __ KISS (Keep It Simple, SEARCH)! Google::getUri( http://www.google.com ); Archives::getUri( http://marc.theaimsgroup.com/?l=php-general ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF output to a variable
On Thursday 25 November 2004 01:27, Justin Palmer wrote: ? //Get the output and send the email send_mail.php //uses the class MIME_mail (http://www.cetusa.org/temp/MIME.class.phps) //WARNING I know that this is not how it is intended to be used, //but this is the what I want to accomplish. $fp = fopen(create_pdf.php); This is going to open 'create_pdf.php' via the local filesystem. $pdf = fpassthru($fp);//actually returns the number of characters read, Here you've stored the contents of 'create_pdf.php' into $pdf which is definitely not what you want. Any help on this would be great. If you know of some search terms that would get me going in the right direction that would be great also (I don't mind doing the research). If fpdf does not allow its output to be saved directly to file then use the output buffering functions to capture the output. Examples in manual (as usual). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I feel sorry for your brain... all alone in that great big head... */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF Help
Nathan Mealey wrote: Anyone who is familiar with using FPDF to generate PDFs, I'd really appreciate some suggestions here: I am using the following code, virtually identical to that used in the FPDF tutorial examples. But I keep getting a parse error for the first line containing the variable $this. In the tutorial they do not declare this variable prior to using it the same way as in the example below, but when I try and do this, it's a no go. Any ideas? Suggestions? the code -- define('FPDF_FONTPATH','../../../font/'); require('../fpdf.php'); class PDF extends FPDF { function Header() { //Arial 12 $this-SetFont('Arial','',12); //Move to the right $this-Cell(80); //Title $this-Cell(30,10,'Title',1,0,'C'); //Line break $this-Ln(20); } function Footer() { //Position at 1.5 cm from bottom $this-SetY(-15); //Arial italic 8 $this-SetFont('Arial','I',8); //Page number $this-Cell(0,10,'Page '.$this-PageNo().'/{nb}',0,0,'C'); } These lines must be outside of the class definition: $pdf=new PDF(); $pdf-AliasNbPages(); $pdf-AddPage(); $pdf-SetFont('Times','',12); for($i=1;$i=40;$i++) { $pdf-Cell(0,10,'Printing line number '.$i,0,1); } $pdf-Output(); This is the brace that closes the class definition, move the above lines below this brace: } Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF Help
Anyone who is familiar with using FPDF to generate PDFs, I'd really appreciate some suggestions here: I am using the following code, virtually identical to that used in the FPDF tutorial examples. But I keep getting a parse error for the first line containing the variable $this. In the tutorial they do not declare this variable prior to using it the same way as in the example below, but when I try and do this, it's a no go. Any ideas? Suggestions? the code -- define('FPDF_FONTPATH','../../../font/'); require('../fpdf.php'); class PDF extends FPDF { function Header() { //Arial 12 $this-SetFont('Arial','',12); //Move to the right $this-Cell(80); //Title $this-Cell(30,10,'Title',1,0,'C'); //Line break $this-Ln(20); } function Footer() { //Position at 1.5 cm from bottom $this-SetY(-15); //Arial italic 8 $this-SetFont('Arial','I',8); //Page number $this-Cell(0,10,'Page '.$this-PageNo().'/{nb}',0,0,'C'); } $pdf=new PDF(); $pdf-AliasNbPages(); $pdf-AddPage(); $pdf-SetFont('Times','',12); for($i=1;$i=40;$i++) { $pdf-Cell(0,10,'Printing line number '.$i,0,1); } $pdf-Output(); } Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF Help
Hi, Friday, April 16, 2004, 2:38:24 AM, you wrote: NM Anyone who is familiar with using FPDF to generate PDFs, I'd really NM appreciate some suggestions here: NM I am using the following code, virtually identical to that used in the NM FPDF tutorial examples. But I keep getting a parse error for the first NM line containing the variable $this. In the tutorial they do not NM declare this variable prior to using it the same way as in the example NM below, but when I try and do this, it's a no go. NM Any ideas? Suggestions? NM the code NM -- NM define('FPDF_FONTPATH','../../../font/'); NM require('../fpdf.php'); NM class PDF extends FPDF NM { NM function Header() NM { NM //Arial 12 $this-SetFont('Arial','',12); NM //Move to the right $this-Cell(80); NM //Title $this-Cell(30,10,'Title',1,0,'C'); NM //Line break $this-Ln(20); NM } NM function Footer() NM { NM //Position at 1.5 cm from bottom $this-SetY(-15); NM //Arial italic 8 $this-SetFont('Arial','I',8); NM //Page number $this-Cell(0,10,'Page '.$this-PageNo().'/{nb}',0,0,'C'); NM } NM $pdf=new PDF(); $pdf-AliasNbPages(); $pdf-AddPage(); $pdf-SetFont('Times','',12); NM for($i=1;$i=40;$i++) NM { $pdf-Cell(0,10,'Printing line number '.$i,0,1); NM } $pdf-Output(); NM } NM Nathan Mealey NM Director of Operations NM Cycle-Smart, Inc. NM P.O. Box 1482 NM Northampton, MA NM 01061-1482 NM [EMAIL PROTECTED] NM (413) 587-3133 NM (413) 210-7984 Mobile NM (512) 681-7043 Fax NM -- NM PHP General Mailing List (http://www.php.net/) NM To unsubscribe, visit: http://www.php.net/unsub.php looks like your missing the closing } to your class proper indenting would probably help -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fpdf
Hi, I want to display the results generated by the query and generate a pdf document (using fpdf) for the users to save. The user should be able to save it by clicking on a save button. I have a script called display.php which displays the result of the query..now I want user to be able to save by pressing save button. That is I want to do this in the display.php script itself, because the result of the query is too large to POST to another script. If I do: $pdf-Output(/tmp/new.pdf); then I can save the pdf document..but I want this to happen only if the user clicks on save button and he/she should be able to download it by doing so. How to do this? Thanks in advance, Mukta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fpdf
The way I would do it is I would make the Save button (or link) point to display.php?save... Now in the display.php I would have it figure out if save is in the URL, if it is then it should output a pdf file instead of a html file. This does however mean that your query is done twice (once for seeing the results with the save button at the bottom, and then again when you hit save) If you only want your query run once then you must save the pdf on the first attempt and then set the link to something like /someUniqueNumber/file.pdf Does that make sense? If you need more guidance just email me. Andrew - Original Message - From: Mukta Telang [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Thursday, July 31, 2003 11:27 AM Subject: [PHP] fpdf Hi, I want to display the results generated by the query and generate a pdf document (using fpdf) for the users to save. The user should be able to save it by clicking on a save button. I have a script called display.php which displays the result of the query..now I want user to be able to save by pressing save button. That is I want to do this in the display.php script itself, because the result of the query is too large to POST to another script. If I do: $pdf-Output(/tmp/new.pdf); then I can save the pdf document..but I want this to happen only if the user clicks on save button and he/she should be able to download it by doing so. How to do this? Thanks in advance, Mukta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FPDF and MySQL
If you look at the tutorial no. 5 on www.fpdf.org, all you need is to change LoadData function, example: function LoadData($condition) { $res=mysql_query(SELECT * FROM table WHERE 1 AND ($condition)); while($data[]=mysql_fetch_row($res) ) { } return $data; } Chuck Payne wrote: Hi, I found a free pdfclass called FPDF http://www.fpdf.org, that I can use with PHP to create pdf files with. Before someone tells me Read The Manual, I have read their page and used Google to search for notes on how called mysql into a PDF and I am lost. Does anyone know where there is a tutorial. Thanks, Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF and MySQL
Hi, I found a free pdfclass called FPDF http://www.fpdf.org, that I can use with PHP to create pdf files with. Before someone tells me Read The Manual, I have read their page and used Google to search for notes on how called mysql into a PDF and I am lost. Does anyone know where there is a tutorial. Thanks, Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FPDF (was Re: [PHP] pdflib)
sorry, should of made it clear I amusing FPDF (http://fpdf.org/) library which looks like it douse the headers for you. Ben At 18:05 18/03/2002, [EMAIL PROTECTED] wrote: On Mon, 18 Mar 2002, Ben Edwards wrote: This looks good, however when I try the examples I get: %PDF-1.3 3 0 obj endobj 4 0 obj stream 2.834646 0 0 2.834646 0 841.89 cm 2 J 0.2 w BT /F1 5.64 Tf ET BT 11 -16.692 Td (Hello World !) Tj ET endstream endobj 5 0 obj endobj 1 0 obj endobj 2 0 obj endobj 6 0 obj endobj 7 0 obj endobj xref 0 8 00 65535 f 000337 0 n 000424 0 n 09 0 n 87 0 n 000236 0 n 000512 0 n 000586 0 n trailer startxref 664 %%EOF Rather than acrobat being started. Any ideas? header('Content-Type: application/pdf'); miguel * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php