SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member chendra's Avatar
    Join Date
    Jun 2003
    Location
    earth
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question help on php+pdflib

    hello everybody..

    i'm a student from Indonesia planning to use pdflib for my final project, i'm learning to use it but found some problem while just starting.. i'm a php newbie (sorry..)
    my platform: php 4.3.1 + apache 1.3.27 on Win2KPro.
    pdflib version: 5.0.1-Windows

    i was trying the example files, i've done as instructed in the php's readme.txt, set pdflib as a DSO for php. i didn't uncomment extension=php_pdf.dll in php.ini, instead i add extension=lib_pdf.dll

    hello.php and pdfclock.php work out fine.
    then i tried image.php, it came up with a blank page and in apache's error log:

    [Thu Jun 26 03:44:47 2003] [error] PHP Fatal error: PDFlib error [1016] PDF_load_image: Couldn't open AUTO file 'nesrin.jpg' for reading (file not found) in c:\apache\htdocs\php\pdflibex\image.php on line 20

    i tried modifying image.php, changing the $searchpath from "../data" to the absolute path and it worked out fine. how do i get it to read relative path? i've tried using '\\' or '\' to change '/' but it only works with the absolute path.

    then when i tried businesscard.php it came up dying with this message:
    Couldn't open input file boilerplate.pdf.

    then i tried changing the $searchpath.. same, can't open the input file.

    it happens with the other examples like chartab.php, invoice.php and quickreference.php (of course with different input filenames). any suggestion?

    Another question is how to use OR where to put the security parameter. i was trying to save and encrypt the image.pdf or hello.pdf on my disk. i've tried putting:
    PHP Code:
    PDF_set_parameter($p"userpassword""usrpwd");
    PDF_set_parameter($p"masterpassword""mstpwd");
    PDF_set_parameter($p"permissions""noprint"); 
    before PDF_Close($p); but it came up with this error on apache:

    [Thu Jun 26 03:34:35 2003] [error] PHP Fatal error: PDFlib error [2124] PDF_set_parameter: Can't set parameter 'userpassword' in 'document' scope in c:\apache\htdocs\php\pdflibex\image.php on line 31

    but when i didn't encrypt it, the file was saved on the apache's main program file (C:\Apache). is that where the file is _supposed_ to be saved in? the PDF_open_file command:
    PHP Code:
    PDF_open_file($p"image.pdf"); 
    well, it's a long message for silly questions, but any help is greatly appriciated
    thanks!
    john

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    bump

  3. #3
    SitePoint Member chendra's Avatar
    Join Date
    Jun 2003
    Location
    earth
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    .. bump again!

    update:
    i've tried looking in pdflib's mailing list's archieve, some ppl have experience the same thing but it seems that there's no solution yet..

    i've tried changing my php, downgrade it to 4.2.1, 4.2.2 and 4.3.0 (haven't tried 4.3.2 yet), the result is the same..

    so anybody have any experience with pdflib's examples on php? any configuration? anything? thanks for reading anyway..
    poor me

    hehehe
    john

  4. #4
    SitePoint Member chendra's Avatar
    Join Date
    Jun 2003
    Location
    earth
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay, problem solved..

    for any of you (probably newbies like me) who face the same problem:

    - you should use the ABSOLUTE PATH for searchpath function on Win32 or PHP binding.. you can track the absolute path using functions like realpath or basename.. etc, creativity!

    - for errors in invoice.php: use quotations around the key names in the array like: {"quantity"} -> around line 115, same for 'name', 'price', etc.

    above information from someone inside
    thanks
    john


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •