cancel
Showing results for 
Search instead for 
Did you mean: 

XSL Fo PDF in SAP MII

Former Member
0 Kudos


Hello Everyone,

I am currently working on generating a PDF using xsl fo pdf renderer. I am able to create my PDF successfully. Now I want to put a logo/image in this pdf either as an image or as an background image. I am tried to do so using fo:external graphic and background-image component but I am not able to get it. Pls help me with the same. My code snippet is as follows:

----------------------------------------------------------------------------------------------

Using fo:external-graphic:

    <fo:block  height="auto" width="80px" >Hi

     <fo:external-graphic src="http://<url>:<portno>/Path/Image.GIF"> 

     </fo:external-graphic>Bye

    </fo:block>

----------------------------------------------------------------------------------------------

Using fo:block background-image:

    <fo:block  height="auto" width="80px" background-image="http://<url>:<portno>/Path/Image.GIF"> Hello Everyone..!

    </fo:block>

I also tried background-color property. It works quite well.

----------------------------------------------------------------------------------------------

Also I am using MII 12.2 and 12.1 both.

Any help is really appreciated.

Regards,

Minakshi.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Minakshi,

do you have any details on how i would use xsl fo to pdf ? do i just need to add fop jar file to the server and add an xsl transformation action with the xsl including the fo and with the output as pdf  file ?

kind regards,

Garreth.

Former Member
0 Kudos

Hello Garreth,

You need to follow following steps:

1. Upload and deploy fop-xmii jar fle.

2. In the transaction, Include the pdf renderer block.

3. Inputs to the renderer block:

     a. InputXml: Any dummy xml.

     b. InputXsl: Xsl made to format the pdf

     c. Trace: 0

4. Output from renderer block:

     Create a Transaction output variable of binary type. Map rendered output of block to this output variable.

5. Now you may access the output pdf using following path:

http://<Server>:<PortNo>//XMII/Runner?Transaction=<TransactionPath>&OutputParameter=<ParamName>&Content-Type=application/pdf&isBinary=true


I hope this is useful. Let me know if you face any problem.

Regards,

Minakshi

Former Member
0 Kudos

Hi Minakshi,


Thanks for the response , i'm afraid i'm stumbling at the first hurdle, where do i download fop-xmii.jar ? is this from the Sap Market Place ?

or do i just copy the fop.jar file i downloaded from https://xmlgraphics.apache.org/fop/ ?

or do i upload the PdfAction.jar and include the fop.jar as a dependency ?

Appreciate all the help !!!


kind regards,

Garreth.

Former Member
0 Kudos

Hello Garreth,

Sorry but I do not have any idea of how to download it. But surely its not fop.jar file directly of even PdfActions.jar.

You may post a new query for how to download it.

Regards,

Minakshi

Former Member
0 Kudos

thanks i'll try that

ponilango_p
Explorer
0 Kudos

Dear Minakshi,

I would suggest you to try the points listed below.

1. If the image is in a different site, try authenticating it using hard-coded URL parameters

2. It is better to download the external images to your MII project files into a Web Folder and link it in your XSL

3. Syntax for linking a file or image into your XML when the object lies within a MII Web folder is,

"/XMII/CM/<ProjectName>/<FolderName>/<Image>.<Extension>"

Don't place the image into a Catalog/Object/Meta-Inf folder, it wont help.

With regards,

Ponilango P

Former Member
0 Kudos

Hi Ponilango,

I have placed my image in MII web folder itself. Also tried giving the path as "/XMII/CM/<ProjectName>/<FolderName>/<Image>.<Extension>" . But there is no difference. The generated PDF doesnt show any error but it neither shows the image.

Regards,

Minakshi

ponilango_p
Explorer
0 Kudos

I am on 14.0 now, will give this a try and let you know on Sunday/later.

I see your other thread is also active - let us hope you will get response from others as well.

With regards,

Ponilango P

Former Member
0 Kudos

Hi Ponilango,

Have u tried it? Pls let me know if u get any idea of it.

Regards,

Minakshi