Ask a Question related to Adobe Acrobat Macintosh, Design and Development.

  1. #1

    Default PDF Problem

    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");
    # $Id: hello.php,v 1.9 2003/03/14 17:07:56 rp Exp $
    /* create a new PDFlib object */
    $p = PDF_new();
    /* open new PDF file; insert a file name to create the PDF on disk */
    PDF_open_file($p, "");
    PDF_set_info($p, "Creator", "hello.php");
    PDF_set_info($p, "Author", "Rainer Schaaf");
    PDF_set_info($p, "Title", "Hello world (PHP)!");
    PDF_begin_page($p, 595, 842); /* start a new page */
    $font = PDF_load_font($p, "Helvetica-Bold", "winansi", "");
    PDF_setfont($p, $font, 24.0);
    PDF_set_text_pos($p, 50, 700);
    PDF_show($p, "Hello world!");
    PDF_continue_text($p, "(says PHP)");
    PDF_end_page($p); /* close page */
    PDF_close($p); /* close PDF document */
    $buf = PDF_get_buffer($p);
    $len = strlen($buf);
    header("Content-type: application/pdf");
    header("Content-Length: $len");
    header("Content-Disposition: inline; filename=hello.pdf");
    print $buf;
    PDF_delete($p); /* delete the PDFlib object */
    ?>

    and here is the error message i got when i ran the script :

    X-Powered-By: PHP/4.0.4pl1 Content-type: text/html
    Warning: Function registration failed - duplicate name - pdf_set_info in
    C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2
    Warning: Function registration failed - duplicate name -
    pdf_set_info_creator in C:\InetPub\wwwroot\Nedcor Internal
    Live\test\hello.php on line 2
    Warning: Function registration failed - duplicate name - pdf_set_info_title
    in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2
    Warning: Function registration failed - duplicate name -
    pdf_set_info_subject in C:\InetPub\wwwroot\Nedcor Internal
    Live\test\hello.php on line 2
    Warning: pdf: Unable to register functions, unable to load in Unknown on
    line 0

    Fatal error: Call to undefined function: pdf_new() in
    C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 6
    PHP Warning: Unable to load dynamic library
    'c:\php\extensions/libpdf_php.dll' - The specified procedure could not be
    found. in Unknown on line 0

    Can anyone seens this before? if so, could you please give me some hints how
    i can convert a text file to pdf file under windows environment?


    Thx alot

    Jack
    Jack Guest

  2. Similar Questions and Discussions

    1. contribute problem - access denied file may not existpermission problem
      Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,...
    2. Problem playing Quicktime thru .DCR embedded in HTML - pathreferencing problem?
      Greetings earthlings and Director heads. Here's the problem: created an HTML file containing shockwave (dcr) movie that calls quicktime movies in...
    3. Uploading problem = weird warning (was: access denied problem.....)
      Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the...
    4. #21611 [Opn]: Problem with version_compare() (Was: Problem with pear cli and release numbers)
      ID: 21611 Updated by: et@php.net -Summary: Problem with pear cli and release numbers Reported By: jan at horde...
    5. Problem with Apache Web Server config file and PHP (please give advice on what problem may be me)
      HI: Can anyone refer me to someone that can help with the problem below. I installed Apache Web Server on my laptop which has Windows XP. I...
  3. #2

    Default Re: PDF Problem

    "Jack" <nedcor4@nedcor.com.hk> schrieb im Newsbeitrag
    news:20030829085238.3663.qmail@pb1.pair.com...
    > 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
    Joerg Behrens Guest

  4. #3

    Default PDF problem

    Occasionally when I create PDF files and email them to my client's, the I's and L's convert to a colon. They look fine on my screen and print fine on my end. My client however is experiencing this. There is no rhyme or reason to when it happens either and it doesn't happen all the time. I work on a MacIntosh and the people having the problems when they receive my PDF's are using PC's. Any thoughts?
    Michelle_L._Young@adobeforums.com Guest

  5. #4

    Default Re: PDF problem

    Are you 100% sure ALL the fonts are embedded?

    Otherwise you might be a victim of soft substitution occuring at the
    client workstation in an attempt to soft-view the characters ...

    Otherwise for test purposes, get at least one workstation on EXACTLY the
    same version as yours ....

    Jon
    Jon_Bessant@adobeforums.com Guest

  6. #5

    Default Re: PDF problem

    Hi Michelle

    Once Adobe had an error in its Library where this occurred. If I remember correctly the same engine was also used in Acrobt 5 to display and print PDF's.

    Some OEM's integrated this same PDF Library into their workflows and therefor also produce a "wrong" output. With todays versions of the workflows out in the field the problem is gone. Only companies that did not update might have problems. E.g. Trueflow 2 has this behavior.

    Peter
    peter kleinheider Guest

  7. #6

    Default Re: PDF problem

    Yes, all fonts are embedded. So if I'm hearing you guys correctly, upgrading to Acrobat 7.0 should solve this problem?
    Michelle_L._Young@adobeforums.com Guest

  8. #7

    Default Re: PDF problem

    Correct, the side that does the output has to upgrade

    Peter
    peter kleinheider Guest

  9. #8

    Default Re: PDF problem

    Thank you so much for your help!
    Michelle_L._Young@adobeforums.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139