[xep-support] How to use a fo:instream-foreign-object as a background-image ?

From: Kirch Fritz <Friedrich.Kirch_at_ADDRESS_REMOVED>
Date: Mon Apr 16 2018 - 07:14:51 PDT

Hi,

My goal is to give a fo:block a colored gradient background.

instead of using the @background-image=.. attribute I want to use a fo:instream-foreign-object to specify a fo:blockā€™s background

I tried this, but the fo:instream-foreign-object is not inside the fo:block.

<fo:block border="3pt solid blue" margin="3mm" background-color="yellow">
<fo:instream-foreign-object block-progression-dimension="0%" content-width="100%" content-height="scale-to-fit" scaling="non-uniform">
                              <svg xmlns="http://www.w3.org/2000/svg" version="1.0" height="1in" width="8.5in">
                                             <defs>
                                                            <linearGradient id="grad1" x1="100%" y1="0%" x2="0%" y2="0%">
                                                                          <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
                                                                          <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
                                                           </linearGradient>
                                            </defs>
                                            <rect width="8.5in" height="1in" fill="url(#grad1)" />
                              </svg>
               </fo:instream-foreign-object>
                SOME TEXT INSIDE THE PARAGRAPH SOME TEXT INSIDE THE PARAGRAPH SOME TEXT INSIDE THE PARAGRAPH SOME TEXT INSIDE THE PARAGRAPH SOME TEXT INSIDE THE PARAGRAPH
</fo:block>

Using <fo:block @background-image=ā€a_svg_file.svgā€> technique, I have to specify a real image file, but I cant do this, because I donā€™t know the colors of this svg-file in advance. The colors are coming from my xml-file.
Using <fo:block @background-image=ā€url(ā€˜http:///a_url)ā€> technique, I have to presuppose, that there is a internet connection, which doesnā€™t reliably exist
Using <fo:block @background-color=ā€a_colorā€> technique, I can produce solid background color only. No gradients.
Using a multistep-technique i.e. First produce a SVG according to my xml and secondly produce the pdf using this SVG is not accepted. I want only one step

Do you have any ideas how to use a colored gradient as a fo:blockā€™s background?

Kind regards

Friedrich Kirch
IT2media GmbH & Co KG
NĆ¼rnberg, Germany

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html

Received on Mon Apr 16 07:13:42 2018

This archive was generated by hypermail 2.1.8 : Mon Apr 16 2018 - 07:13:52 PDT