note 95236 deleted from function.pdf-load-image by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Dec 2009 19:54:07 +0000 |
| Subject: | note 95236 deleted from function.pdf-load-image by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164163@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
Reason: integrated
----
If you are using PDFLib under Windows and you are wondering why your image file can not be found
(using a relative path), here is your answer!
From the manual (PDFlib 5.0.3, chapter 2.9.1):
"File name handling in PHP. Unqualified file names (without any path
component) and relative file names for PDF, image, font and other disk
files are handled differently in Unix and Windows versions of PHP:
-PHP on Unix systems will find files without any path component in the
directory where the script is located.
- PHP on Windows will find files without any path component only in the
directory where the PHP DLL is located.
In order to provide platform-independent file name handling use of
PDFlibâs Search-Path facility (see Section 3.1.6, »Resource
configuration and File Searching«, page 47) is strongly recommended.
Solution: use Search-Path
$pdf->set_parameter('SearchPath', 'path_to_your_images');
or
PDF_set_parameter('SearchPath', 'path_to_your_images');