You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Oosterbaan, Douglas S. (LNG-DAY)" <Do...@lexisnexis.com> on 2004/07/09 20:08:38 UTC

Invoking FOP from C++

Has anyone invoked FOP 0.20.5 from a C++ process?  We have a large
existing C++ component which needs the services provided by
FOP.   I've downloaded the binary and played around with it,
and was considering using a fork() and exec(), but FAQ 2.8 states:

"It is best to avoid exec'ing FOP, use the library interface
instead."

FAQ 2.8 is in reference to the Jave Runtime.exec() call, but 
I assume the same would apply to a C++ exec().  Also, I need
to get back the page count that is included in the results 
object returned by FOP.

My next approach is to download the source, write a Java
wrapper for FOP, and call my wrapper process either through
an exec() or a CORBA call.  But if possible I would like to 
just use the binary in it's original form.

Has anyone else had any experience calling FOP from C++?
Thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Invoking FOP from C++

Posted by Steve Afdahl <st...@charter.net>.
Have you looked into the Java Native Interface (JNI)?  It works both 
ways.  You can use it in Java to call native libraries and you can also 
use it to call Java code from C/C++.  This should give you access to the 
page count property as well as controlling output creation.

This link might help you get started:

http://java.sun.com/docs/books/tutorial/native1.1/implementing/index.html

Oosterbaan, Douglas S. (LNG-DAY) wrote:

>Has anyone invoked FOP 0.20.5 from a C++ process?  We have a large
>existing C++ component which needs the services provided by
>FOP.   I've downloaded the binary and played around with it,
>and was considering using a fork() and exec(), but FAQ 2.8 states:
>
>"It is best to avoid exec'ing FOP, use the library interface
>instead."
>
>FAQ 2.8 is in reference to the Jave Runtime.exec() call, but 
>I assume the same would apply to a C++ exec().  Also, I need
>to get back the page count that is included in the results 
>object returned by FOP.
>
>My next approach is to download the source, write a Java
>wrapper for FOP, and call my wrapper process either through
>an exec() or a CORBA call.  But if possible I would like to 
>just use the binary in it's original form.
>
>Has anyone else had any experience calling FOP from C++?
>Thanks.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: fop-user-help@xml.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Invoking FOP from C++

Posted by Gunnar Liljas <gu...@leon.se>.
At 20:08 2004-07-09, you wrote:
>Has anyone else had any experience calling FOP from C++?
>Thanks.

No, but I'm using it very successfully from a C# application, by executing 
the binary. Of course there is a performance penalty, and the level of 
control isn't fine grain, but it's stable.

/Gunnar 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org