[PHP] Re: pdf
How can i see, everyon here use that class. I use it too. It always worked fine to me. weetat [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] 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 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Generator
Dan Harrington wrote: I have a TON of forms that I have to populate, can I make a PDF file using Acrobat Professional, and then use PHP to populate those forms and have text inserted into the pre-made text fields that I made using Acrobat? And if so, what is the best tool for that? I'd prefer to do it for free, but spending $$ is fine too. Thanks Dan Rick Lim wrote: What is the best FREE pdf generator for PHP? fpdf will only draw your documents, there is no way to use it with forms. and i don't know any way to process pdf forms in php, but i didn't really need it yet. if you find any solutions, please post them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Generator
Rick Lim wrote: What is the best FREE pdf generator for PHP? i used FPDF without any problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Generator
I have a TON of forms that I have to populate, can I make a PDF file using Acrobat Professional, and then use PHP to populate those forms and have text inserted into the pre-made text fields that I made using Acrobat? And if so, what is the best tool for that? I'd prefer to do it for free, but spending $$ is fine too. Thanks Dan Rick Lim wrote: What is the best FREE pdf generator for PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PDF Generator
Why not use JavaScript? It's supported well in Acrobat Professional. Jud. Original Message: - From: Dan Harrington [EMAIL PROTECTED] Date: Sun, 4 Dec 2005 09:12:51 -0700 To: php-general@lists.php.net Subject: [PHP] Re: PDF Generator I have a TON of forms that I have to populate, can I make a PDF file using Acrobat Professional, and then use PHP to populate those forms and have text inserted into the pre-made text fields that I made using Acrobat? And if so, what is the best tool for that? I'd prefer to do it for free, but spending $$ is fine too. Thanks Dan Rick Lim wrote: What is the best FREE pdf generator for PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PDF Generator
I used this in the past: http://www.ros.co.nz/pdf/ Fully self-contained. My only frustration was that didn't support multiple tables on one row. Maybe I was asking too much... ;) On 12/4/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Why not use JavaScript? It's supported well in Acrobat Professional. Jud. Original Message: - From: Dan Harrington [EMAIL PROTECTED] Date: Sun, 4 Dec 2005 09:12:51 -0700 To: php-general@lists.php.net Subject: [PHP] Re: PDF Generator I have a TON of forms that I have to populate, can I make a PDF file using Acrobat Professional, and then use PHP to populate those forms and have text inserted into the pre-made text fields that I made using Acrobat? And if so, what is the best tool for that? I'd prefer to do it for free, but spending $$ is fine too. Thanks Dan Rick Lim wrote: What is the best FREE pdf generator for PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Anas Mughal
[PHP] Re: PDF printing under windows.
Dave Lists [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm generating PDFs under windows using PDFlib and all is easy. What I am wondering though, and google reveals nothing usefull, can I print the PDF to a network printer from windows? I'm presuming to print the file I would ahve to use COM and open it under Acrobat? Anyone done this before and have any pointers? I'm printing out invoices and what to automate the task. I print PDF files using the following code (which prints them to the default printer): SHELLEXECUTEINFO sei; ZeroMemory(sei, sizeof(SHELLEXECUTEINFO)); sei.cbSize = sizeof(SHELLEXECUTEINFO); sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS; sei.lpVerb = _T(print); sei.lpFile = pFile;// - complete path to file to print sei.hwnd = CDLBUtils::g_Data.m_hWnd; sei.nShow = SW_HIDE; if (ShellExecuteEx(sei) sei.hInstApp (HINSTANCE)32) { // ok } else { // failed } Note1: You can change the default printer before calling this. Note2: Acrobat will launch, and may stay running even after the printing process has finished DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: pdf properties
On Thu, 10 Feb 2005 12:28:19 -0700, Jason Motes [EMAIL PROTECTED] wrote: Hello, Is there anyway to retrieve the properties from a pdf file using php? When you right click on a pdf file in windows you can see the title of the file and you can change this property there also. I wrote a php page that lists all files in a certain directory. I want to be able show the actual title of the document instead of just the file name. I have searched the manual and google, everything that comes up refers to generating pdfs on the fly, not working with an already made pdf. Thanks in Advance, Jason Motes If you study the structure of pdf in a text editor, you'll notice that it is quite readable. If you go to the end of a document, prefferably a small one, you will see the trailer. Here is al list of all bytepositions of the objects the pdf document contains. These objects can be images, text, page descriptions, page groups and so on. There can also be a reference to the properties of the document wich can contain creator, author, title etc. It is easy to read the objects, but to change them can prove rather difficult, as you will need to update the trailer informaition with new byteposition for all objects that comes after the properties (hard to explain), unless you keep the new info the same length. But as you only need to extract the title you can do this with a simple regexp. while(filelistingstuff) { $document = file_get_contents($pdf); if(preg_match(/\/Title\s\((.*?)\)/i,$document,$match)) { $title = $match[1]; } else { $title = $filename; } } Hope this helps. -- Stian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PDF from PHP generated HTML, possible?
Many thanks to all (especially Brad) for your input on this. Although I have not got as far as producing PDFs I have managed to implement output buffering and saving of generated pages under a hashed name, and of course retrieving it instead of doing all the queries again. I've trimmed slightly the code below as I do some trimming of the session contents before hashing. I also have to work out how to handle some functionality that uses session data, so will probably generate a 'hashed' csv file along with the html file. For those that are interested (if only to comment on my coding skills !!) what I have done is: ( It may not be pretty but it seems to work ) page1.php - ?php session_start(); include(includes/staticHtml.inc.php); if ($_SERVER['QUERY_STRING']) $to_hash = $_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING']; else $to_hash = $_SERVER['PHP_SELF']; $static = new static_html($to_hash); if ($static-status == 'new') // Did not exist { ob_start(); // Start output buffering }else{ echo $static-html; exit(); } ... query processing etc ... $str = ob_get_contents(); $static-save_html($str); ob_flush(); ? staticHtml.inc.php -- ?php class static_html { var $status; var $html; var $hash; var $static_path; var $path; function static_html($fullUrl) { $this-$static_path = ../static/; $ssn = implode('_',$_SESSION); $this-hash = md5($fullUrl.$ssn); $this-path = $this-$static_path.$this-hash.'.htm'; $this-find_html(); } function find_html() { if (file_exists($this-path)) { $this-html = file_get_contents($this-path); $this-status = 'old'; }else{ $this-status = 'new'; } } function save_html($str) { if ($this-find_html() == 'old') { // replace static page?? }else{ $fp = fopen($this-path,'w'); $sts = fwrite($fp,$str); fclose($fp); } } } ? -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: 23 September 2004 23:36 To: Php-General Subject: Re: [PHP] Re: PDF from PHP generated HTML, possible? On Thu, 23 Sep 2004 22:39:06 +0100, Graham Cossey [EMAIL PROTECTED] wrote: Brad: When you say a hash of the query string do you mean passing the variable part of the URL thru mhash to obtain a hash/key/digest or whatever you wish to call it? If so, do you recommend any particular hash, ie MD5, GOST or TIGER? Not knowing much about these things, I imagine passing the same text thru a given hash algorithm multiple times will always return the same result. I tend to use md5, but the other hash functions ought to work too. I don't know about GOST and TIGER, but I know php has support for SHA1 and another that I don't remember at the moment. So: Requested URL http://server/app/page1.php?cust=12345t=3 Variable part hashed page1.php?cust=12345t=3 hash mdg4789gnvh095n If the following URL exists use it, otherwise do processing, get buffer and write to this file. http://server/app/static/mdg4789gnvh095n.html Yep. I would check for the file (or whatever mechanism you use to store the cache) instead of the URL. You could write a class or a few functions that could do this check for you based on the hash. If PDF of page requested: Send the current URL (http://server/app/static/mdg4789gnvh095n.html) through pdf-o-matic or similar. You might consider creating the pdf version at the same time you create the html. I depends on how your app works. Can you request a pdf before you reque Is that about right? Yep. I think you've got it. Many thanks No problem =) - Brad -- 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] Re: PDF from PHP generated HTML, possible?
Hmmm, I cannot believe that there are people on this list who do not know how to use Google. I tried convert HTML to pdf and came up with loads of results - including http://www.easysw.com/htmldoc/pdf-o-matic.php that seems to allow you to see their source code. HTH, Mikey - Original Message - From: Graham Cossey [EMAIL PROTECTED] Newsgroups: php.general To: Php-General [EMAIL PROTECTED] Sent: Thursday, September 23, 2004 3:44 PM Subject: PDF from PHP generated HTML, possible? Following the topic about generating PDF documents from within PHP has prompted a thought... Is it possible to have PHP dynamically build an HTML page (from database data etc) and provide an option to output the page as PDF without going through all the database query routine again? In other words, to produce a PDF file from dynamic HTML. This is because I have seen at least one 'product' that reports to produce PDF from HTML 'files'. Any help/guidance/suggestions/URLs welcomed. Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PDF from PHP generated HTML, possible?
That's fine for static pages, my question was regarding dynamic pages that I did not wish to pass through the database querying again. I understand that if my dynamic page is http://server/app/page1.php?cust=12345t=3 I can supply that URL which will result in HTML that can be processed by (for example) pdf-o-matic. However, as I've already run all the queries necessary I would like to not have to run them all again when requesting the PDF. Thanks Graham. -Original Message- From: Mikey [mailto:[EMAIL PROTECTED] Sent: 23 September 2004 15:50 To: [EMAIL PROTECTED] Subject: [PHP] Re: PDF from PHP generated HTML, possible? Hmmm, I cannot believe that there are people on this list who do not know how to use Google. I tried convert HTML to pdf and came up with loads of results - including http://www.easysw.com/htmldoc/pdf-o-matic.php that seems to allow you to see their source code. HTH, Mikey - Original Message - From: Graham Cossey [EMAIL PROTECTED] Newsgroups: php.general To: Php-General [EMAIL PROTECTED] Sent: Thursday, September 23, 2004 3:44 PM Subject: PDF from PHP generated HTML, possible? Following the topic about generating PDF documents from within PHP has prompted a thought... Is it possible to have PHP dynamically build an HTML page (from database data etc) and provide an option to output the page as PDF without going through all the database query routine again? In other words, to produce a PDF file from dynamic HTML. This is because I have seen at least one 'product' that reports to produce PDF from HTML 'files'. Any help/guidance/suggestions/URLs welcomed. Graham -- 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] Re: PDF from PHP generated HTML, possible?
On Thu, 23 Sep 2004 16:25:27 +0100, Graham Cossey [EMAIL PROTECTED] wrote: That's fine for static pages, my question was regarding dynamic pages that I did not wish to pass through the database querying again. I understand that if my dynamic page is http://server/app/page1.php?cust=12345t=3 I can supply that URL which will result in HTML that can be processed by (for example) pdf-o-matic. However, as I've already run all the queries necessary I would like to not have to run them all again when requesting the PDF. At the beginning of your page1.php script (and any others that you want to cache as html and pdf) you could check to see if you have created cached version of the page, if so, redirect to that page. If not, use output buffering and save the generated content to a file. Run that file through the pdf-o-matic to create the pdf version. You could name the file by creating a hash of the query string and any other variable that affects the dynamic content of that page (for example, session variables). So the original request might look like your example. http://server/app/page1.php?cust=12345t=3 Which, if it has a cached html version would redirect to a different URL before any of your queries are executed. http://server/html/hash-of-your-variables.html Or, for the pdf version. http://server/pdf/hash-of-your-variables.pdf - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PDF from PHP generated HTML, possible?
Thanks to all, this is indeed most enlightening for me as I've only been using PHP for about 6 months. The output buffering and saving of generated HTML pages (using a hashed name) could be very beneficial, saving hundreds of quite lengthy MySQL queries each day. Brad: When you say a hash of the query string do you mean passing the variable part of the URL thru mhash to obtain a hash/key/digest or whatever you wish to call it? If so, do you recommend any particular hash, ie MD5, GOST or TIGER? Not knowing much about these things, I imagine passing the same text thru a given hash algorithm multiple times will always return the same result. So: Requested URL http://server/app/page1.php?cust=12345t=3 Variable part hashed page1.php?cust=12345t=3 hash mdg4789gnvh095n If the following URL exists use it, otherwise do processing, get buffer and write to this file. http://server/app/static/mdg4789gnvh095n.html If PDF of page requested: Send the current URL (http://server/app/static/mdg4789gnvh095n.html) through pdf-o-matic or similar. Is that about right? Many thanks Great list !! Graham -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: 23 September 2004 17:17 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: PDF from PHP generated HTML, possible? On Thu, 23 Sep 2004 16:25:27 +0100, Graham Cossey [EMAIL PROTECTED] wrote: That's fine for static pages, my question was regarding dynamic pages that I did not wish to pass through the database querying again. I understand that if my dynamic page is http://server/app/page1.php?cust=12345t=3 I can supply that URL which will result in HTML that can be processed by (for example) pdf-o-matic. However, as I've already run all the queries necessary I would like to not have to run them all again when requesting the PDF. At the beginning of your page1.php script (and any others that you want to cache as html and pdf) you could check to see if you have created cached version of the page, if so, redirect to that page. If not, use output buffering and save the generated content to a file. Run that file through the pdf-o-matic to create the pdf version. You could name the file by creating a hash of the query string and any other variable that affects the dynamic content of that page (for example, session variables). So the original request might look like your example. http://server/app/page1.php?cust=12345t=3 Which, if it has a cached html version would redirect to a different URL before any of your queries are executed. http://server/html/hash-of-your-variables.html Or, for the pdf version. http://server/pdf/hash-of-your-variables.pdf - Brad -- 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] Re: PDF from PHP generated HTML, possible?
On Thu, 23 Sep 2004 22:39:06 +0100, Graham Cossey [EMAIL PROTECTED] wrote: Brad: When you say a hash of the query string do you mean passing the variable part of the URL thru mhash to obtain a hash/key/digest or whatever you wish to call it? If so, do you recommend any particular hash, ie MD5, GOST or TIGER? Not knowing much about these things, I imagine passing the same text thru a given hash algorithm multiple times will always return the same result. I tend to use md5, but the other hash functions ought to work too. I don't know about GOST and TIGER, but I know php has support for SHA1 and another that I don't remember at the moment. So: Requested URL http://server/app/page1.php?cust=12345t=3 Variable part hashed page1.php?cust=12345t=3 hash mdg4789gnvh095n If the following URL exists use it, otherwise do processing, get buffer and write to this file. http://server/app/static/mdg4789gnvh095n.html Yep. I would check for the file (or whatever mechanism you use to store the cache) instead of the URL. You could write a class or a few functions that could do this check for you based on the hash. If PDF of page requested: Send the current URL (http://server/app/static/mdg4789gnvh095n.html) through pdf-o-matic or similar. You might consider creating the pdf version at the same time you create the html. I depends on how your app works. Can you request a pdf before you reque Is that about right? Yep. I think you've got it. Many thanks No problem =) - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Templates with PHP
Merlin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] HI there, I am wondering if it is possible to generate a pdf page with pdflib based on a existing pdf document. For example using an invoice template and filling in the values with php. The last time I checked it (1 year ago) you needed the PDI library of PDFLib to open an existing PDF file and do something with it. Go to the pdflib page and check if this is still the case. I simple workaround would be to place placeholders into your template (e.g.[###filed1###] or something similar) then get the file contents with get_file_contents() or fopen() and replace the placeholders with their values with str_replace(). Hope it helps. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Templates with PHP
[snip] I am wondering if it is possible to generate a pdf page with pdflib based on a existing pdf document [/snip] Look into the pdflib examples that you get when you download pdflib. I am pretty sure there is an example invoice template in it. Also look into the pdf blocks in pdflib. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF and dynamic PNG
if nothing worked out, simply right the dynamic png to a temp file (e.g tempimg.png) then include this png file in your PDF document :) hope this helps, Ammar Dominik Heeb [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I succeed in creating PDF files dynamically with PHP (including inserting static PNG images), and also succeed in creating PNG images dynamically. However, I can't insert dynamically created PNG images into PDF files, neither with pdf_open_image_file, nor with pdf_open_png. Is this impossible? D o m i n i k Example: function putimage ($pdf, $fullfilename, $x, $y, $width) { // init $extension = substr($fullfilename, strrpos ($fullfilename, .)+1); $pdfimage = pdf_open_image_file($pdf, $extension, $fullfilename); // define scale $sourceimagewidth = pdf_get_value ($pdf, imagewidth, $pdfimage); $scale = $width / $sourceimagewidth; // put image pdf_place_image($pdf, $pdfimage, $x, $y, $scale); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF File generation on Fly in PHP
on windows you need to comment out the php_pdf.dll (or similar) in php.ini and reboot apache/iis to enable the pdf extension. pete Vijay Killu wrote: Hello, I've just came through a function which generates PDF files on fly in a php script. On going through the documentation, I came to know that It needs to be compiled in a different fashion using a configure parameter. I would be happy if someone could help me out. I use Windows XP and PHP 4.3.3 and I couldn't find the configure.exe anywhere in my system... Thanks Regards, ___ Vijay Corporate Communications Satyam Computer Services Limited TSR Towers, Rajbhavan Road Somajiguda, Hyderabad-500 082 INDIA * : +91 (40) 23306767 Extn 7825 * : [EMAIL PROTECTED] Göd döësn't pläy dícë. - Älbërt Ëínstëín -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Problem
Jack [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Dear all I want to convert a text file to pdf format and store it in somewhere in my harddisk. I had found out that there is a dll inside my php4.04 directory (c:\php\extensions\php_pdf.dll) and from php.ini i had check that the extension_dir=c:\php\extensions; extension=php_pdf.dll had actived; now i obtained a simple script from the net, and tried to test it , but it return alot of errors! Here is the testing script : ?php dl(php_pdf.dll); This is not needed because you already have load the extension in your php.ini when used 'extension=php_pdf.dll' $ext = 'pdf'; if(!extension_loaded($ext)){ // windowsstyle = php_gd[2].dll // unix = gd.so dl((strIstr(PHP_OS, 'win')) ? 'php_'.$ext.($ext == 'gd2' )? 2: ''.'.dll' : $ext.'.so'); } might be a solution. But keep in mind that dl() cant use when safe_mode is on and when running a threaded webserver and mod_php under windows. Warning: Function registration failed - duplicate name - pdf_set_info_creator in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2 This ever happens when you try to load a extension twice or when creating a function wich already exists. regards Joerg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: pdf information..
a pdf-page can have almost every format you want. originally you work with postscript-dots, where 72 dots are 1 inch. it's easy from that point to calculate from metric system, where 1 inch is 2.54 cm or 25.4 mm. with this in mind you can exactly define the height and width of your pdf-page. i suggest you use one of the ready-made pdf-php-classes. ciao SVEN Louie Miranda [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hello, I have been given a task to generate a business card program over the web. The option that i can think of it to make it easier is generate a pdf based on the user's experience over my preview program on the web. Now im wondering does pdf have those image resolution size? I mean on image you can specify 100x100 pixels and make the resolution into 300dpi. How about pdf? -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: pdf information..
Sven, thanks for the info! sven [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... a pdf-page can have almost every format you want. originally you work with postscript-dots, where 72 dots are 1 inch. it's easy from that point to calculate from metric system, where 1 inch is 2.54 cm or 25.4 mm. with this in mind you can exactly define the height and width of your pdf-page. i suggest you use one of the ready-made pdf-php-classes. ciao SVEN Louie Miranda [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hello, I have been given a task to generate a business card program over the web. The option that i can think of it to make it easier is generate a pdf based on the user's experience over my preview program on the web. Now im wondering does pdf have those image resolution size? I mean on image you can specify 100x100 pixels and make the resolution into 300dpi. How about pdf? -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- 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] Re: pdf file error?
Never mind. I found the error. thanks Micah Montoy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I did my research. We'll, searched the net anyway without a solution. I am getting the error: Fatal error: PDFlib error: function 'PDF_set_info' must not be called in 'object' scope in c:\inetpub\wwwroot\webpage10\example\utilities\pdf_maker\act_p_makePDF.php on line 4 I read that this is because file write permissions are not set on the directory where the file is to be written, so I set write permissions and still the exact same thing. I even set write permissions for the whole directory and restarted IIS with the same results. Now when I use the exact same script in a completely different directory on the webserver, it creates the PDF just fine. The permissions are the same, just a different directory. Here is the PDF script I'm testing out: ?php $pdf = pdf_new(); pdf_open_file($pdf, test.pdf); pdf_set_info($pdf, Author, Uwe Steinmann); //line 4 pdf_set_info($pdf, Title, Test for PHP wrapper of PDFlib 2.0); pdf_set_info($pdf, Creator, See Author); pdf_set_info($pdf, Subject, Testing); pdf_begin_page($pdf, 595, 842); pdf_add_outline($pdf, Page 5); $font = pdf_findfont($pdf, Times New Roman, winansi, 1); pdf_setfont($pdf, $font, 10); pdf_set_value($pdf, textrendering, 1); pdf_show_xy($pdf, Times Roman outlined, 50, 750); pdf_moveto($pdf, 50, 740); pdf_lineto($pdf, 530, 740); pdf_stroke($pdf); pdf_end_page($pdf); pdf_close($pdf); pdf_delete($pdf); echo A HREF=getitem.phpfinished/A; ? Anyone encounter such a thing and have a possible solution for this? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PDF Creation
I'm trying to use PDFreportsLite in Windows. in the /src folder, there is a rep.php example. But when i run the rep.php script, nothing apears, only the white page and the window done status. In the PDFReportsLite.php, i set: $MM_PDFReportsLite_HOSTNAME = 127.0.0.1; $MM_PDFReportsLite_DBTYPE = mysql; $MM_PDFReportsLite_DATABASE = pdfreportslite; $MM_PDFReportsLite_USERNAME = root; $MM_PDFReportsLite_PASSWORD = root; In the Yaps.inc.php, i set: if (!defined('YTMP_DIR')) define('YTMP_DIR',./tmp); // Complete GhostScript filename if (!defined('YGS_DIR')) define('YGS_DIR',./gs); Can you help me? From: Alexandru COSTIN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: PDF Creation Date: Thu, 13 Mar 2003 22:17:37 +0200 Hello, You should also look at http://www.interakt.ro/products/PDFreportsLite/ It allows you to avoid using the API and concentrate on the reports Alexandru -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 411 2610 Christopher J. Crane [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am just getting into PDF creation and I am having some issues. Can anyone send me a simple script that creates a PDF doc. I would like it to open in the browser after creation, not create a file. If someone has a simple one with an image placement as well that would be great. I can figure it out if I have a working one, but everything I tried so far does not work. Here is the latest I tried and the error I get. Warning: Wrong parameter count for pdf_close_image() in /home/inxdesig/public_html/demos/pennytraders.com/pdf.php on line 20 Fatal error: PDFlib error: function 'PDF_stroke' must not be called in 'page' scope in /home/inxdesig/public_html/demos/pennytraders.com/pdf.php on line 22 ?php $pdf = PDF_open(); pdf_set_info_author($pdf, Luca Perugini); PDF_set_info_title($pdf, Brochure for FlyStore); pdf_set_info_creator($pdf, See Author); pdf_set_info_subject($pdf, FlyStore); PDF_begin_page($pdf, 595, 842); PDF_add_outline($pdf, Item .$data[1]); pdf_set_font($pdf, Helvetica-Bold , 20, winansi); pdf_set_text_rendering($pdf, 0); pdf_show_xy($pdf, FlyStore Catalogue 2000,50,780); PDF_show_xy($pdf, Item : .$data[1], 100, 700); PDF_show_xy($pdf, Description : .$data[2], 100, 620); $im = PDF_open_jpeg($pdf, pass4_sml.jpg); pdf_place_image($pdf, $im, 100, 300, 3); pdf_close_image ($im); pdf_stroke($pdf); PDF_end_page($pdf); PDF_close($pdf); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Charla con tus amigos en línea mediante MSN Messenger: http://messenger.yupimsn.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Creation
Hello, You should also look at http://www.interakt.ro/products/PDFreportsLite/ It allows you to avoid using the API and concentrate on the reports Alexandru -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 411 2610 Christopher J. Crane [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am just getting into PDF creation and I am having some issues. Can anyone send me a simple script that creates a PDF doc. I would like it to open in the browser after creation, not create a file. If someone has a simple one with an image placement as well that would be great. I can figure it out if I have a working one, but everything I tried so far does not work. Here is the latest I tried and the error I get. Warning: Wrong parameter count for pdf_close_image() in /home/inxdesig/public_html/demos/pennytraders.com/pdf.php on line 20 Fatal error: PDFlib error: function 'PDF_stroke' must not be called in 'page' scope in /home/inxdesig/public_html/demos/pennytraders.com/pdf.php on line 22 ?php $pdf = PDF_open(); pdf_set_info_author($pdf, Luca Perugini); PDF_set_info_title($pdf, Brochure for FlyStore); pdf_set_info_creator($pdf, See Author); pdf_set_info_subject($pdf, FlyStore); PDF_begin_page($pdf, 595, 842); PDF_add_outline($pdf, Item .$data[1]); pdf_set_font($pdf, Helvetica-Bold , 20, winansi); pdf_set_text_rendering($pdf, 0); pdf_show_xy($pdf, FlyStore Catalogue 2000,50,780); PDF_show_xy($pdf, Item : .$data[1], 100, 700); PDF_show_xy($pdf, Description : .$data[2], 100, 620); $im = PDF_open_jpeg($pdf, pass4_sml.jpg); pdf_place_image($pdf, $im, 100, 300, 3); pdf_close_image ($im); pdf_stroke($pdf); PDF_end_page($pdf); PDF_close($pdf); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib
Bogomil Shopov wrote: hi folks Is there any way to include in PDF file .gif file with more than 8 colors? Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil No, there's no *standard* way. I dare say that PDFlib itself could be hacked to accomodate things differently, but that's a PDFlib issue itself, not PHP's issue. If you have the option, PNGs might be better in this situation because they can be greater than 8 bits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib
thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib problem with Gif files (2)
Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF to PHP (code)
Jason, I had trouble with PDFLib too, and I turned to this site for help! I found this much easier to implement and the webmaster will give you lots of help!! http://ros.co.nz/pdf/ This does not use PDFLib. Jason Morehouse [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I've got a pretty detailed PDF that I need to dynamically re-create with PHP / pdflib. Before I sit around for endless hours inputing x, y, fonts and line coordinates, is there *any* tool that can help automate this? Basically, the miracle I'm looking for would take a PDF file, and export it to PHP code that can reproduce it -- or something along that line. Thanks in Advance! -J -- Jason Morehouse (jm[ät]netconcepts[döt]com) Netconcepts - http://www.netconcepts.com Auckland, New Zealand Linux: Because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF creation with PDF-LIB samples?
You could try: http://www.fpdf.org/ Someone posted recently and I've quickly whacked it into my toolbox :-) Jim . Andras Kende [EMAIL PROTECTED] wrote in message 004801c1c0e3$26bf6070$b59fb841@K..">news:004801c1c0e3$26bf6070$b59fb841@K..; Hello, Trying to create some pdf documents on the fly with php and mysql.. I search the web but not yet found any easy way to do this... Tried Yaps but it requires ghostscript which didnt install on a cobalt raq4 because it it requires some more programs (glibc...etc..)... Anyone can give some hint where to start? Thanks, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF print page creation...
If the problem is just the web address, etc., in the bottom of the page, that can be turned off. In NN, File/Page Setup and uncheck the boxes in the header and footer In IE, File/Page Setup and remove the stuff in the header and footer fields. Lauri Vain wrote: Hello, A client requested a script to create a page to print out the list of clients that are subscribed to a chosen service. This list will be printed and then faxed to an outer source because that's how the second company that oursources the service requests it. The present script creates a HTML page with an image, text and a few tables. The problem with the HTML page is that the browser prints the web address of the script to the lower left corner of the sheet (and also things like Page 1 from 1). The PDF is meant to eliminate it all. How complex would it be to code this script to generate the PDF file. How much time would it take to make a PDF creator based on existing script that gets the data out of the database? Remember, the PDF would have to contain tables and a logo as well (image). The text has to be positioned and aligned as requested by the client. So my questions: 1. How hard would it be to create such a script? 2. How much time would it take? (any common pitfalls that could make coding time longer?) 3. What are the best classes/wrappers out there to handle the job? 4. Or would it be better to get a HTML to PDF converter (do such things exist and do they do a good job?) Thanks in advance! Yours, Lauri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PDF Generator
[EMAIL PROTECTED] (Krushna Kumar) wrote: Hi, Can someone help me on how i could generate or create a pdf file an fill contents php.net/pdf I would recommend you to take a look at this lib for creating pdf's it's way easier than doing it 'by hand' yourself. http://sourceforge.net/projects/pc4p/ -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PDF Download / View
I'm not 100% sure, but try adding one more header: Header(Content-Disposition: attachment; filename=\ . $filename. \); Ville Mattila wrote: Hello world, I've made a little script which simply returns a pdf file through it (script file called dl.php in the chart-directory): ? $file_size = filesize($filepath); Header(Content-Type: application/pdf); Header(Content-Length: .$file_size); readfile($filepath); ? This script works fine when there is Acrobat Reader Browser -plug-in installed to users' box so that the PDF File appears into the IE's or Netscapes' normal window. But if and when user wants to save the pdf file (which should be allowed), some problem appear. In the case that user right-clicks the link to this script and selects Save the file as... (or something, I have Finnish version of IE ;) the browser thinks that user is downloading chart.html -file! I suppose that same phenomenon appears when there is no Acrobat plug-in installed and browser doesn't find corresponding action for application/pdf -mime type - it begins to download file. Any suggestions how user can download the file via that script as the file will be saved as pdf-file? Thanks and cheers, - Ville . Ville Mattila Ikaalinen, Finland gsm +358-40-8497506 [EMAIL PROTECTED] www.pilotmedia.fi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]