on 01-02-2014 7:18 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.