Today we have released an initial version of a PHP interface for Prince:
Prince-php.zip
This has a php class for calling Prince from php.
Prince-php.zip
This has a php class for calling Prince from php.
<cfscript>
pr = CreateObject("Com", "PrinceCom.Prince", "local");
pr.SetPrincePath("C:\Prince\engine\bin\prince.exe");
pr.AddStyleSheet("C:\Prince\test\test1.css");
pr.AddStyleSheet("C:\Prince\test\test2.css");
pr.SetEncryptInfo(128, "secretPassword1", "secretPassword2", True,
True, True, True);
if (pr.Convert("C:\Prince\examples\webarch.html",
"C:\Prince\output\output.pdf") eq 1)
WriteOutput("Successful");
else
WriteOutput("Unsuccessful");
ReleaseComObject(pr);
</cfscript>
<cfscript>
pr = CreateObject("java", "com.princexml.Prince");
pr.init("C:\Prince\engine\bin\prince.exe");
pr.addStyleSheet("c:\Prince\test\test1.css");
pr.addStyleSheet("c:\Prince\test\test2.css");
pr.setEncryptInfo(128, "secretPassword1", "secretPassword2", True, True, True, True);
if (pr.Convert("C:\Prince\examples\webarch.html",
"C:\Prince\output\output.pdf"))
WriteOutput("Successful");
else
WriteOutput("Unsuccessful");
</cfscript>
<cfset princeEXE = #ExpandPath('Prince/engine/bin/prince.exe')#>
<cfset pdfOutput = #ExpandPath('Output.pdf')#>
<cfset xmlOutput = #ExpandPath('Output.xml')#>
<cffile action="write" file="#xmlOutput#" nameconflict="makeunique" output="#courseXml#">
<cfscript>
pr = CreateObject("java", "com.princexml.Prince");
pr.init(princeEXE);
if (pr.convert(xmlOutput, pdfOutput))
WriteOutput("Successful");
else
WriteOutput("Unsuccessful");
</cfscript>