Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Xsl fo使用nfop创建PDF固定大小的背景图像_C#_Xslt_Xsl Fo_Nfop - Fatal编程技术网

C# Xsl fo使用nfop创建PDF固定大小的背景图像

C# Xsl fo使用nfop创建PDF固定大小的背景图像,c#,xslt,xsl-fo,nfop,C#,Xslt,Xsl Fo,Nfop,我已经使用以下方法将背景图像添加到我的pdf中: <fo:simple-page-master master-name="LetterLandscapePortada" page-height="21.59cm" page-width="28.94cm" > <fo:region-body margin="0cm" background-repeat="no-repeat" background-image="url(file://D:/XSL/fo

我已经使用以下方法将背景图像添加到我的pdf中:

<fo:simple-page-master master-name="LetterLandscapePortada" page-height="21.59cm" page-width="28.94cm" >
              <fo:region-body margin="0cm" background-repeat="no-repeat" background-image="url(file://D:/XSL/fondoPortada.jpg)" />          
</fo:simple-page-master>

但是,为了将图像“自动适配”到页面,我遇到了一些问题,因为图像大于页面大小


是否可以添加属性以使背景图像适合页面?

xslfo规范没有为此指定任何内容。 见:


然而,有很多方法可以解决这个问题。在xslfo中,您可以在显示任何文本之前添加一个图像,并相应地设置其尺寸,这样它看起来就像是一个“背景”图像(具有最低的z索引)。非xsl解决方案是通过在GIMP这样的编辑器中添加适当的空白/调整大小来修改图像本身,然后像您已经做的那样继续。您也可以使用“位置”属性,尽管如果不修改图像,这些属性几乎没有帮助。

因此,只有解决方法,没有与自动拟合相关的属性