Forum News

Prince ActiveX DLL 5.0 released

Cong
We have released the Prince ActiveX DLL 5.0 today. The DLL provides a COM interface that can be called from many programming languages. The DLL can be downloaded here. Please let us know if you have any suggestions or comments.
JohnClarke
It is good to hear that a COM interface has been created.

I'm not sure if there is any documentation for the COM object but it may be useful to note that:

1. You must register the dll in windows using regsvr32
2. The interface class handle is: "princecom.prince"

In Visual Foxpro, I instantiate with something like this:

loMyPrinceObject = createobject( "princecom.prince" )

I suppose that C++ and VB would be similar.

-jc

John Clarke
Cornerstone Systems Northwest Inc.

JohnClarke
Also, (I just thought of this now) I wonder how hard it would be to have event methods fire as ConvertXmlToPdf() works away on a document. For example:

onPageStart( tnPagenumber )
onPageEnd( tnPagenumber )
onDocumentStart()
onDocumentEnd()
onTimeout() which would fire after nSeconds
onError( toError )
onWarning( toWarning )
onConvertingImage()

The reason for having these methods is mainly to give the parent application a bit more control over what is happening during conversion. It would be able to decide when to stop processing (if it needed to stop prematurely, or decided this document was taking too long). As well, it is always good for debugging to know on which page an error occured etc.

2 more related questions:

1. Is there a reason why the "PrincePath" needs to be passed in the "ConvertXmlToPdf" method and not just set once as an attribute?

2. Is there a reason why there is no attribute that holds error information? Again, this is really useful information in debugging (especially for my malformed XHTML docs)

These are just ideas/suggestions to talk about. Perhaps this thread should be posted elsewhere? -jc

John Clarke
Cornerstone Systems Northwest Inc.

mikeday
Thanks for the feedback and suggestions, John! :D

We will revisit the COM interface in the future and add event methods for accessing error messages and progress information from Prince.

(Currently, the best way to debug a misbehaving XHTML document is to run it through Prince from the GUI or the command-line to see the error messages; alternatively, there is always the W3C markup validator if you are interested in strict compliance to the XHTML specification).
JohnClarke
Michael, I see you have made some significant improvements in the current release. The COM will certainly be useful from our perspective.

I'm working on making our older apps XHTML compliant. The reason I'm interested in having Prince give automated feedback is so that we can incrementally fix any markup rendering problems as they arise. Having good error information available on the fly would be really valuable for us during this process but more importantly once the PDF service goes production (so we can monitor incomplete requests etc.).

That said, I can already identify plenty of corrections to make with the HTMLTidy COM interface. I think this will give us a good start and put us in a position to test Prince more vigorously.

Thanks for the update. -John

John Clarke
Cornerstone Systems Northwest Inc.