Hi,
you're right that the error message is confusing. You will get more information if you
raise the log level.
> [[o:PDDocument]]->protect((o:ProtectionPolicy)[o:StandardProtectionPolicy]).
> Cause: java.lang.IllegalArgumentException
In one of the next versions we will include the classloader in the output, so that the
error message will read:
[[o:PDDocument]]->protect((o:ProtectionPolicy@CL1)[o:StandardProtectionPolicy@CL2])
The problem is that StandardProtectionPolicy is assignment-incompatible to ProtectionPolicy.
Please re-read the "java platform issues" and the "class loading" section from the readme and
change the java_require() call so that it includes all interconnected libraries.
Regards,
Jost Boekemeier
P.S.: The code I've tested is:
<?php require_once("http://127.0.0.1:8080/JavaBridge/java/Java.inc");
$here=realpath(dirname($_SERVER["SCRIPT_FILENAME"]));
if(!$here) $here=getcwd();
java_require("$here/PDFBox-0.7.3.jar;$here/bcprov-jdk15-137.jar;$here/bcmail-jdk15-137.jar");
$ap = new Java("org.pdfbox.pdmodel.encryption.AccessPermission");
$ap->setCanModify(false);
$oDoc = new Java("org.pdfbox.pdmodel.PDDocument");
$oProtect = new Java("org.pdfbox.pdmodel.encryption.StandardProtectionPolicy","test","test",$ap);
$doc = $oDoc->load( "$here/test.pdf");
$doc->protect($oProtect);
?>
__________________________________
Yahoo! Clever: Sie haben Fragen? Yahoo! Nutzer antworten Ihnen. www.yahoo.de/clever
|