RE: [xep-support] running XSLDriver

From: Hamacher, Eric <Eric_Hamacher@gallup.com>
Date: Fri May 22 2009 - 07:47:27 PDT

Thank you:

I am following the code in JAXPSample, but its not working for me. I get a zero-length PDF. Do I need to set more properties?
My xml and xsl are valid and will produce a PDF on the command line. Thanks again.

          System.setProperty("com.renderx.xep.CONFIG", realPath + "XEP" + System.getProperty("file.separator") + "xep.xml");

        SAXSource source = null;

        FormatterImpl xep = null;
        xep = new FormatterImpl(new Properties());

        File in = new File(savePath + System.getProperty("file.separator") + name + "_xml.xml");
        InputSource saxsrc = new InputSource(in.toURL().toString());
        source = new SAXSource(saxsrc);

        FOTransformer transformer = null;
        File xsl = new File(savePath + System.getProperty("file.separator") + name + "_xsl.xsl");
        StreamSource stylesheet = new StreamSource(xsl);
        transformer = new FOTransformer(stylesheet, xep);

        OutputStream out = null;
        out = new BufferedOutputStream(new FileOutputStream(savePath + System.getProperty("file.separator") + name + "_pdf.pdf"));
        transformer.transform(source, new FOTarget(out, "PDF"));
        out.close();

J. ERIC HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI 53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-----Original Message-----
From: owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com] On Behalf Of Michael Sulyaev
Sent: Thursday, May 21, 2009 3:29 PM
To: xep-support@renderx.com
Subject: Re: [xep-support] running XSLDriver

Hamacher, Eric wrote:
> String[] args = new String[1];
> String argument = "-fo somefile_fo.xml -pdf somefile_pdf.pdf";
> args[0] = "\"" + argument + "\"";
> XSLDriver.main(args);

Hello Eric,

XSLDriver.main(new String[] {"somefile_fo.xml","somefile_pdf.pdf"});
works, but it's not a good idea anyway.

> I cannot find the API documentation for this class.
XEP API is available as a separate product called "Connectivity Kit"
(http://www.renderx.com/tools/devkit.html). A wide variety of ways to
use XEP in custom Java code is described in API, and sample code is
provided for all the options, including those for web applications.

Regards,
Michael Sulyaev
RenderX
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html

IMPORTANT NOTICE: This e-mail message and all attachments, if any, may contain confidential and privileged material and are intended only for the person or entity to which the message is addressed. If you are not an intended recipient, you are hereby notified that any use, dissemination, distribution, disclosure, or copying of this information is unauthorized and strictly prohibited. If you have received this communication in error, please contact the sender immediately by reply e-mail, and destroy all copies of the original message.

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Fri May 22 08:26:27 2009

This archive was generated by hypermail 2.1.8 : Fri May 22 2009 - 08:26:34 PDT