SetaPDF_Merger::setPdfVersionCallback()
Description
class SetaPDF_Merger extends SetaPDF {
void setPdfVersionCallback ( callback $pdfVersionCallback )
}
The API normally produces PDF documents with the highest version number of the read PDF documents.
In some special cases it is necesarry to adjust the PDF version of the resulting document(s). You can use this method to define a callback function/method, which gives you the control over the PDF version.
You should only use this method, if you know what you're doing.
Parameters
$pdfVersionCallback
A callback function or method which will be called to adjust the resulting PDF version.
The passed argument is of the pseudo-type callback and will be used with call_user_func()-function.
The SetaPDF-Merger API will call your given function/method with one parameter: (string)$pdfVersion.
The function/method has to return the new, final PDF version.
Keep in mind that a change to a lower PDF
version could result in errorious document.
A prototype of a callback function could look like this:
function pdfVersion($pdfVersion) {
$maxVersion = '1.6';
return version_compare($maxVersion, $pdfVersion, '<') ? $maxVersion : $pdfVersion;
}
$merger->setPdfVersionCallback('pdfVersion');
Version
Available since Version 1.4