apache fop 可以生成的最大页面数是多少?
您好,我正在使用 apache fop,当页数超过大约 130 页时,它无法生成 pdf .... 页数或 xml 文件的长度是否有限制...
线程“main”中出现异常 java.lang.OutOfMemoryError:Java 堆
空间 在 java.io.BufferedReader 处。(BufferedReader.java:80) 在 java.io.BufferedReader 处。(BufferedReader.java:91) 在 org.apache.xml.dtm.ObjectFactory.findJarServiceProviderName(ObjectFac tory.java:579) 在 org.apache.xml.dtm.ObjectFactory.lookUpFactoryClassName(ObjectFactory .java:373) 在 org.apache.xml.dtm.ObjectFactory.lookUpFactoryClass(ObjectFactory.jav 答:206) 在 org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:131)
位于 org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:101) 在 org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:135) 在 org.apache.xpath.XPathContext.reset(XPathContext.java:350) 在 org.apache.xalan.transformer.TransformerImpl.reset (TransformerImpl.ja 弗吉尼亚州:505) 在 org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme rImpl.java:1436) 在 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:709) 在 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:1284) 在 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:1262) 在 org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) 在 org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) 在 org.apache.fop.cli.Main.startFOP(Main.java:166) 在 org.apache.fop.cli.Main.main(Main.java:197)
Hi I was working with apache fop and when the number of pages exceeds about 130 pages ,it could not generate the pdf ....
Is there any limit to page number or the length of xml file...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap
space
at java.io.BufferedReader.(BufferedReader.java:80)
at java.io.BufferedReader.(BufferedReader.java:91)
at org.apache.xml.dtm.ObjectFactory.findJarServiceProviderName(ObjectFac
tory.java:579)
at org.apache.xml.dtm.ObjectFactory.lookUpFactoryClassName(ObjectFactory
.java:373)
at org.apache.xml.dtm.ObjectFactory.lookUpFactoryClass(ObjectFactory.jav
a:206)
at org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:131)at org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:101) at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:135) at org.apache.xpath.XPathContext.reset(XPathContext.java:350) at org.apache.xalan.transformer.TransformerImpl.reset(TransformerImpl.ja va:505) at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme rImpl.java:1436) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:709) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:1284) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp l.java:1262) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我创建了由数十万行长的 xml 生成的报告。然而,我在创建充满 svgs 的较小报告时遇到了一些问题。
您的问题可能是 java 默认情况下仅分配 32 MB 内存(如果我没记错的话),因此内存不足。
在 fop.bat 文件中(假设您在 Windows 上运行)添加以下设置
rem 增加标准 Java VM 堆大小,以便更大的报告获得足够的内存
设置 JAVAOPTS=-Xmx512M
并按如下方式更改执行行
"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main % FOP_CMD_LINE_ARGS%
这应该至少适用于 0.95
I've created reports that are made from xmls that were several hundred thousand lines long. However I have had some issues creating smaller reports filled with svgs.
Your issue is probably that java by default only allocates 32 MB memory (if I recall correctly) so it's running out of memory.
In the fop.bat file (assumimg you're running on windows) add the following setting
rem Increase standard Java VM heap size, so that bigger reports get enough memory
set JAVAOPTS=-Xmx512M
and alter the execution line as follows
"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
This should work with 0.95 at least