cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.1 XML to PDF transformation with XML-FO

former_member301120
Active Participant
0 Kudos

Hello to all,

is there a way to transform a xml-stream to PDF using XML-FO using default methods of PI 7.1.

Best regards

Christian

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Chritian,

I have worked using the blog you are refering with PI 7.1 . We need to use NWDS 7.1 for creating of custome adaptor module.

Few additional jar files need to be used when working with NWDS 7.1

Check the log files after deployement of adapter module.

The problem is few classes are missing in the jar files. you need to search the exact jar files with the required classes..

Regards,

Syed

former_member301120
Active Participant
0 Kudos

Hello,

thanks for all replies.

I've tried it with xls-fo. It worked fine with XI 3.0, but on PI 7.1 after tranformation of on xml to pdf, every other messages runs in an error: "Could not open input stream"

This error is caused by, that xsl-fo uses xerces parser and the system property sax.driver is set to the following value:


property: [aris.org.xml.sax.driver] value: [com.sun.org.apache.xerces.internal.parsers.SAXParser] 

In order to process other messages, we have to restart the j2ee engine, but at next xls-fo transformation the error with "Could not open input stream" occurs again, till the j2ee engine is restarted again ... and so on.

At SAP help there is the following code, in oder to obtain a tmp parser.


ClassLoader oldLoader = null;

SAXParserFactory fact;

try {

   oldLoader = Thread.currentThread().getContextClassLoader();

   Thread.currentThread().setContextClassLoader(

     this.getClass().getClassLoader());

   fact = SAXParserFactory.newInstance();

} finally {

   Thread.currentThread().setContextClassLoader(oldLoader);

}

I tried this but without success.

Regards Christian

henrique_pinto
Active Contributor
0 Kudos

There's no J2EE in PI 7.1. It's JEE 5.

Anyway, have you checked whether you're using Java 5 compliant libraries?

The libraries that worked for XI 3.0 (J2EE, Java 1.4) may not work anymore.

Regards,

Henrique.

former_member301120
Active Participant
0 Kudos

Hello,

I think this is a bug at SAP J2EE engine.

I've opened a ticket but without any helpfull answer.

So I'll close this thread.

Regards

Shabarish_Nair
Active Contributor
0 Kudos

JFYI~~

/people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi you can also try this method

iprieto
Contributor
0 Kudos

Hi Cristian,

Have you thought about the posibility to use an itext java library for do it?

The performance is better and it's not difficult implement this issue with a Java Module or Java Mapping.

Best Regards

Ivá

udo_martens
Active Contributor
0 Kudos

Hi Christian,

please have a look to Krishnakumars blog [XI: Generate PDF file out of file adapter|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2072] [original link is broken] [original link is broken] [original link is broken];. From that blog: "In the below example, we receive a simple XML file and transform it to XSL FO format using XSLT mapping"

Regards,

Udo

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

in case you won't find any you can always use free

xmlgraphics.apache.org/fop/

I'd suggest using this way - I bet there is nothing in PI that supports

more XSL-FO tags

Regards,

Michal KRawczyk