PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 16th, 2007, 10:45 AM
popeye's Avatar
popeye popeye is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: New York, New York
Posts: 31 popeye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 50 sec
Reputation Power: 3
Install PDFLib and use PDF function

I am trying to use the PDF functions with PHP-5 on a windows environment. I downloaded the PDFLib lite 7.0.2 but I can not find anywhere how to get it to work. I get the following error:

-------------
PHP Fatal error: Class 'PDFlib' not found in C:\Inetpub\wwwroot\PDF.php on line 4
-------------

The PHP documentation does not provide much help either. I appreciate any help or any pointer on this subject.

Thanks

Last edited by popeye : August 16th, 2007 at 11:07 AM.

Reply With Quote
  #2  
Old August 16th, 2007, 11:18 AM
cwf's Avatar
cwf cwf is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 354 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 7 h 8 m 8 sec
Reputation Power: 3
Download the PECL Win binary that matches your PHP version from php.net - http://www.php.net/downloads.php

Unzip the files.

Copy the php_pdf.dll file into your php extensions folder.

Add the following line to your php.ini - extension=php_pdf.dll

Stop and start your web server to get the change made to php.ini to take effect. Since you appear to be using IIS, the easiest way to accomplish this step is to reboot your computer.

Reply With Quote
  #3  
Old August 16th, 2007, 02:48 PM
popeye's Avatar
popeye popeye is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: New York, New York
Posts: 31 popeye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 50 sec
Reputation Power: 3
I did what you suggested and it looked like it worked for a while but then when I tried to run the following sample script from PHP5 documentation:

==========================================
Example 2. Hello World example from PDFlib distribution for PHP 5
Code:

<?php

try {
    $p = new PDFlib();

    /*  open new PDF file; insert a file name to create the PDF on disk */
    if ($p->begin_document("", "") == 0) {
        die("Error: " . $p->get_errmsg());
    }

    $p->set_info("Creator", "hello.php");
    $p->set_info("Author", "Rainer Schaaf");
    $p->set_info("Title", "Hello world (PHP)!");

    $p->begin_page_ext(595, 842, "");

    $font = $p->load_font("Helvetica-Bold", "winansi", "");

    $p->setfont($font, 24.0);
    $p->set_text_pos(50, 700);
    $p->show("Hello world!");
    $p->continue_text("(says PHP)");
    $p->end_page_ext("");

    $p->end_document("");

    $buf = $p->get_buffer();
    $len = strlen($buf);

    header("Content-type: application/pdf");
    header("Content-Length: $len");
    header("Content-Disposition: inline; filename=hello.pdf");
    print $buf;
}
catch (PDFlibException $e) {
    die("PDFlib exception occurred in hello sample:\n" .
    "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " .
    $e->get_errmsg() . "\n");
}
catch (Exception $e) {
    die($e);
}
$p = 0;
?> 

===========================================

I got the following error.

-----------------------------------------------------
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


PDFlib exception (fatal): [1202] PDF_set_parameter: Unknown key 'objorient'
Error in my_thread_global_end(): 1 threads didn't exit
-----------------------------------------------------
or
-----------------------------------------------------
PHP Fatal error: Call to undefined function PDF_begin_document() in C:\Inetpub\wwwroot\JHHLS\PDF.php on line 5
-----------------------------------------------------

I appriciate any comments. Thanks

Last edited by popeye : August 16th, 2007 at 03:25 PM.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Install PDFLib and use PDF function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek