The following tips and tricks are available:
The following tips and tricks are available:
Sometimes PDF documents are not available through the filesystem which is actually a must for all our APIs or FPDI. We belive in this solution because our APIs will just load data into memory, they really need. PDF documents could be very huge, while each PHP installation (mostly) have its memory limits - and reaching them will let the script die.
For some developers this issue isn't important, because they can adjust their memory limits as high as they want. Or other developers simply works with smal pdf documents which are saved in a blob field in a database and don't want to use temporary files in the middle of database and SetaPDF API or FPDI.
For this developers (and others) we'll describe a way, you can solve this problem with "simple" existing php features: stream wrappers
The usage of a stream wrapper will only work with FPDI > 1.2
and all other current SetaPDF APIs in their PHP 5 versions.
The PHP 4 wrapper only supports FPDI and the SetaPDF-Merger.
All other APIs are only supported if you don't do an incremental update.
This class has to be registered as a stream wrapper now:
Now you can simply use the new registered wrapper this way:
Another PHP 5 version could be the following wrapper class, which doesn't rely on the $GLOBAL array:
This class can be used to access variables in any scope by simply passing the desired variable to a static method and using the return value as the URL.