本文介绍了IKVM的FOP:无图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在.NET中成功编译并使用FOP 1.0和IKVM 0.44.5,但是无法在显示的PDF中显示任何图像.

I've successfully compiled and used FOP 1.0 with IKVM 0.44.5 in .NET, however I can't get it to show any images in the resulting PDF.

当我在命令行中通过ikvm运行FOP时,我得到了java.io.EOFException.当我使用Java转换相同的文件时,图片会完美显示.

When I run FOP via ikvm in the command-line, I get a java.io.EOFException. When I transform the same file using java, the Images shows up perfectly.

java.lang.reflect.UndeclaredThrowableException
    at $Proxy0.readUTF(Unknown Source)
    at java.lang.reflect.Method.invoke(Method.java:612)
    at org.apache.xmlgraphics.image.loader.util.ImageUtil$1.invoke(ImageUtil.java:246)
    at $Proxy0.readUTF(Unknown Source)
    at com.sun.imageio.plugins.png.PNGImageReader.parse_iTXt_chunk(PNGImageReader.java:469)
    at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:710)
    at com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(PNGImageReader.java:1543)
    at org.apache.xmlgraphics.image.loader.impl.imageio.PreloaderImageIO.preloadImage(PreloaderImageIO.java:71)
    at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:176)
    at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
    at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
    at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81)
Caused by: java.io.EOFException
    at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:346)
    at java.io.DataInputStream.readUTF(DataInputStream.java:607)
    at javax.imageio.stream.ImageInputStreamImpl.readUTF(ImageInputStreamImpl.java:332)
    ... 49 more

有人使用FOP + IKVM使图像工作吗?任何帮助或指向解决方案的指针将不胜感激!

Has anyone gotten images to work using FOP+IKVM? Any help or pointers to a solution would be highly appreciated!

推荐答案

我对FOP不太了解,但是一个简单的带有图像的示例有效:

I don't know much about FOP, but a simple example with images works:

C:\j\fop-1.0>set JAVACMD=\ikvm-0.44.0.5\bin\ikvm.exe
C:\j\fop-1.0>fop -fo examples\fo\basic\images.fo -pdf images.pdf

这将导致images.pdf看起来不错.

This results in an images.pdf that looks good.

如果您对此有一个复制场景,请随时将其发送给我([email protected]),我来看看.

If you have a repro scenario for this, feel free to mail it to me ([email protected]) and I'll have a look.

更新:感谢引起问题的.png.我用0.44重现了该问题,但是在当前的开发版本中,它可以正常工作.最新的开发快照可从 http://weblog.ikvm.net/

Update: Thanks for the .png that caused the problem. I reproduced the problem with 0.44, but in the current development version it works correctly. The most recent development snapshot is available at http://weblog.ikvm.net/

这篇关于IKVM的FOP:无图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 14:44