#40557 [NEW]: object needed for as parameter but results in error

From: Date: Tue, 20 Feb 2007 12:26:03 +0000
Subject: #40557 [NEW]: object needed for as parameter but results in error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109165@lists.php.net to get a copy of this message
From: ronnie at signet dot nl Operating system: FreeBSD PHP version: 5.2.1 PHP Bug Type: PDF related Bug description: object needed for as parameter but results in error Description: ------------ I want to make an overlay on an existing PDF file, and according to what I find on your website and on the manual of PDFLib is that I need PDF_open_pdi (pdi ->pdf import). the function description on the websites are : int pdf_open_pdi(int resource, string filename, "",0) however, when I make an empty PDF object with: $p=new PDFlib, and I user $p as the first parameter in the call to the function pdf_open_pdi, I get the next errormessage : PDFlib exception occured in hello sample : [0]: PDFlib::open_pdi() expects parameter 1 to be string, object given Reproduce code: --------------- I call to this function like this : <? ... $p = new PDFlib(); ... $filename = "testfile.pdf"; $p->open_pdi($pdf , $filename, ""); ... ?> In my opinion this should work... but it doesnt. http://ronnie.signet.nl/pdftest.php #I'll leave this file in place so you can see what it does Expected result: ---------------- I expected the original pdf file to be opened and added as some sort of background, so I could take the default PDFlib functions to create some sort of overlay function. Actual result: -------------- However, if I create a blank pdf, and open another with open_pdi, instead of that I can do what's written in the PDFlib manual, I get an errormessage in return, that tells me that open_pdi's first parameter should be a string. But if this were a string, how should I be able to operate on it later as if it were a PDF (object) ? I hope someone can figure out some answer for me, that I can make it work. -- Edit bug report at http://bugs.php.net/?id=40557&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40557&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40557&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40557&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40557&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40557&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40557&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40557&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40557&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40557&r=support Expected behavior: http://bugs.php.net/fix.php?id=40557&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40557&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40557&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40557&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40557&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40557&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40557&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40557&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40557&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40557&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40557&r=mysqlcfg

« previous php.bugs (#109165) next »