带有 IKVM 的 FOP:无图像

发布于 2024-10-17 13:27:55 字数 1528 浏览 1 评论 0原文

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

当我在命令行中通过 ikvm 运行 FOP 时,出现 java.io.EOFException。当我使用 java 转换同一文件时,图像完美显示。

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 获取图像吗?任何帮助或指向解决方案的指示将不胜感激!

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.

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香橙ぽ 2024-10-24 13:27:55

我对 FOP 不太了解,但是一个简单的图像示例就可以了:

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 。

如果您有这样的重现场景,请随时将其邮寄给我 ([email protected ])我会看看。

更新:感谢您提供导致问题的 .png。我用 0.44 重现了这个问题,但在当前的开发版本中它可以正常工作。最新的开发快照位于 http://weblog.ikvm.net/

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

This results in an images.pdf that looks good.

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文