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:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #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: 30 popeye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 54 m 37 sec
Reputation Power: 2
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 online now
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 343 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 2 Days 18 h 8 m 33 sec
Reputation Power: 2
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: 30 popeye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 54 m 37 sec
Reputation Power: 2
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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway