Problem with PDFLib

Reply

Join Date: Dec 2006
Posts: 34
Reputation: php_coder is an unknown quantity at this point 
Solved Threads: 0
php_coder php_coder is offline Offline
Light Poster

Problem with PDFLib

 
0
  #1
Jul 10th, 2007
Hello guys
I still could not solve the PDF issue
I am using XAMP server on windows system. I think PDF comes with it by default. (not sure though). I have uncommented the required 2 lines in php config file. Yet no luck. Could somebody please help me out?
I want to run acrobat files through the php script , if possible edit it.

plz plz help needed

Thanks in advance
Prati
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,082
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Problem with PDFLib

 
1
  #2
Jul 11th, 2007
try: http://www.fpdf.org/
doesn't need pdflib in php
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 34
Reputation: php_coder is an unknown quantity at this point 
Solved Threads: 0
php_coder php_coder is offline Offline
Light Poster

Re: Problem with PDFLib

 
0
  #3
Jul 12th, 2007
Originally Posted by digital-ether View Post
try: http://www.fpdf.org/
doesn't need pdflib in php

Hey Ether
Thanks for the reply. I have already tried that. It works fine.
But i want to do with the usual PDF. Can u sugges how ?
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,082
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Problem with PDFLib

 
1
  #4
Jul 13th, 2007
Originally Posted by php_coder View Post
Hey Ether
Thanks for the reply. I have already tried that. It works fine.
But i want to do with the usual PDF. Can u sugges how ?
I just successfully installed PDFlib on windows XP running WAMP. Here is the process:

Installing PDFlib on Apache/PHP running on Windows:

Download PDFLib from:
http://www.pdflib.com/download/pdflib-family/pdflib-7/

Here is the direct download for the currently latest version for windows:
http://www.pdflib.com/binaries/PDFli...SWin32-php.zip

Once you have finished downloading, extract the zip file.
In the folder "bind" choose your php version, and open that folder. (php4 or php5)

Inside that folder, you'll have PHP sub versions, choose your sub version. If you don't know the exact PHP version you'ure using, run a php page with <?php phpinfo(); ?> in it. The PHP version will be printed right at the top of the page.

Inside the sub version folder, you'll find the pdflib's .dll file for your php version.

Copy the .dll file and save the copy in your php extensions folder. This folder is defined in php.ini as "extension_dir". So if you don't know what it is on your machine, open php.ini and search for 'extension_dir'.
On my system is was: c://wamp/php/ext/

Now open php.ini and add the extension. The format for this is:

  1. extension=file.dll

where file is the file name of the extension.

eg:
  1. extension=libpdf_php.dll

Now you have to restart apache, and you should have pdflib installed. I tested this using:

  1. <?php
  2. if (class_exists('PDFlib')) {
  3. echo 'PDF Lib supported';
  4. } else {
  5. echo 'PDF Lib not supported';
  6. }
  7. ?>

I don't know about XAMP, you you might have the pdflib extension already added to your extensions directory. If so, then all you have to do is add the line extension=libpdf_php.dll to php.ini
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 34
Reputation: php_coder is an unknown quantity at this point 
Solved Threads: 0
php_coder php_coder is offline Offline
Light Poster

Re: Problem with PDFLib

 
0
  #5
Jul 13th, 2007
Hi Ether
Thanks for a detailed reply. I did just like u said. and PDFlib is isntalled rightly.
i seem to be getting the following error on trying out the first example in manual


Fatal error: Uncaught exception 'PDFlibException' with message 'Metrics data for font 'Times New Roman' not found' in C:\Program Files\xampp\htdocs\gallery2\examples\search\pdf.php:20 Stack trace: #0 C:\Program Files\xampp\htdocs\gallery2\examples\search\pdf.php(20): pdf_findfont(Resource id #2, 'Times New Roman', 'winansi', 1) #1 {main} thrown in C:\Program Files\xampp\htdocs\gallery2\examples\search\pdf.php on line 20

The Script
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "test.pdf");
pdf_set_info($pdf, "Author", "Uwe Steinmann");
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 1");
$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, 330, 740);
pdf_stroke($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
pdf_delete($pdf);
echo "<A HREF=getpdf.php>finished</A>";
?>


Originally Posted by digital-ether View Post
I just successfully installed PDFlib on windows XP running WAMP. Here is the process:

Installing PDFlib on Apache/PHP running on Windows:

Download PDFLib from:
http://www.pdflib.com/download/pdflib-family/pdflib-7/

Here is the direct download for the currently latest version for windows:
http://www.pdflib.com/binaries/PDFli...SWin32-php.zip

Once you have finished downloading, extract the zip file.
In the folder "bind" choose your php version, and open that folder. (php4 or php5)

Inside that folder, you'll have PHP sub versions, choose your sub version. If you don't know the exact PHP version you'ure using, run a php page with <?php phpinfo(); ?> in it. The PHP version will be printed right at the top of the page.

Inside the sub version folder, you'll find the pdflib's .dll file for your php version.

Copy the .dll file and save the copy in your php extensions folder. This folder is defined in php.ini as "extension_dir". So if you don't know what it is on your machine, open php.ini and search for 'extension_dir'.
On my system is was: c://wamp/php/ext/

Now open php.ini and add the extension. The format for this is:

  1. extension=file.dll
where file is the file name of the extension.

eg:
  1. extension=libpdf_php.dll
Now you have to restart apache, and you should have pdflib installed. I tested this using:

  1. <?php
  2. if (class_exists('PDFlib')) {
  3. echo 'PDF Lib supported';
  4. } else {
  5. echo 'PDF Lib not supported';
  6. }
  7. ?>

I don't know about XAMP, you you might have the pdflib extension already added to your extensions directory. If so, then all you have to do is add the line extension=libpdf_php.dll to php.ini
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,082
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Problem with PDFLib

 
0
  #6
Jul 13th, 2007
see: http://www.modwest.com/help/kb5-261.html

If you need to use the font: Times New Roman, then you have to have the correct files for that font and reference it in your code.
see: the link on how to do it, or in the examples included with the pdflib.

You could also just use "Times-Roman" instead of "Times New Roman" as it is built into pdflib.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1
Reputation: joekemp is an unknown quantity at this point 
Solved Threads: 0
joekemp joekemp is offline Offline
Newbie Poster

Re: Problem with PDFLib

 
0
  #7
Oct 10th, 2007
Also had a few problems getting the latest version of libpdf working with XAMPP. I found out that I was editing the wrong php.ini file! I was editing \xampp\php\php.ini when the actual config file was \xampp\apache\bin\php.ini.

That should make it work!
Joe
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 9
Reputation: sujithfem is an unknown quantity at this point 
Solved Threads: 0
sujithfem sujithfem is offline Offline
Newbie Poster

Re: Problem with PDFLib

 
0
  #8
Dec 11th, 2008
Really wonderful sweet ,thank you
"The fear of the Lord is the beginning of wisdom"
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 1
Reputation: asyouwish is an unknown quantity at this point 
Solved Threads: 0
asyouwish asyouwish is offline Offline
Newbie Poster

Re: Problem with PDFLib

 
0
  #9
Sep 8th, 2009
Excellent, thank you. Exactly what I needed.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC