Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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
Java FOP xsl fo插入图像_Java_Xslt_Xsl Fo_Apache Fop - Fatal编程技术网

Java FOP xsl fo插入图像

Java FOP xsl fo插入图像,java,xslt,xsl-fo,apache-fop,Java,Xslt,Xsl Fo,Apache Fop,我想在xsl fo文件的头中设置一个图像 <fo:static-content flow-name="xsl-region-before"> <fo:block text-align="center" line-height="40pt" start-indent = "10.0cm"> <fo:external-graphic height="auto" width="auto" content-height

我想在xsl fo文件的头中设置一个图像

 <fo:static-content flow-name="xsl-region-before">
            <fo:block text-align="center" line-height="40pt" start-indent = "10.0cm">
               <fo:external-graphic height="auto" width="auto" content-height="auto"
                        content-width="auto" src="url('PDF/logo.png')">
              </fo:external-graphic>        
            </fo:block>
 </fo:static-content>

但我发现错误,文件格式不受支持。。。 我尝试png,bmp,gif,jpg,jpeg每次都出现同样的错误

2014年7月15日晚上8:01:26 org.apache.fop.events.LoggingEventListener processEvent Schwerwiegend:图像不可用。URI:PDF/logo.png。原因:org.apache.xmlgraphics.image.loader.ImageException:不支持该文件格式。未找到PDF/logo.png的图像预加载程序(参见位置13:119) org.apache.xmlgraphics.image.loader.ImageException:不支持该文件格式。未找到PDF/logo.png的图像预加载程序

有人有主意吗


真诚的Niko

我为
src
使用正确的
URI
解决了这个问题:

<fo:block>
    <fo:external-graphic  src="url(file:///D:/logo.png)" />
</fo:block>

阅读规范
XSL

URI
定义:

这与FOP上下文的初始化有关。我不这么认为。您确定您的文件(即所谓的logo.png)实际上是一个png图像吗?检查它,看看它实际上是什么,我打赌它不是PNG。它是什么意思。。。你试过“png,bmp,gif,jpg,jpeg”?你试过什么?哪里