Forum Documentation

How to generate PDF/a-1b with Prince in Foxpro?

StephanNeumann
It has now become necessary to generate "PDF/A-1b" type PDFs in the Netherlands for issue to the courts.

How do I achieve this in Foxpro? Current code for generating PDF works great:

pr=CreateObject("PrinceCom.Prince")
pr.SetPrincePath(oProp.AppStartPath+"prince\bin\prince.exe")
pr.Convert(Mhome+TRIM(bestandnaam)+".htm")

If I insert
pr.SetProfile("PDF/A-1b")
before pr.Convert I get an error message.
mikeday
Currently the COM interface doesn't have a SetProfile method, but you should be able to call SetExtraOptions("--pdf-profile=PDF/A-1b") for the same effect.
StephanNeumann
Thanks for the speedy answer, but alas:

pr=CreateObject("PrinceCom.Prince")
pr.SetPrincePath(oProp.AppStartPath+"prince\bin\prince.exe")
pr.SetExtraOptions("--pdf-profile=PDF/A-1b")
pr.Convert(Mhome+TRIM(bestandnaam)+".htm")

return an OLE error 'unknown name'. Maybe a matter of Prince version?
mikeday
Which version of the COM wrapper are you using? The r6 version should have this method.