Error when using print: Java exception occurred: java.lang.IllegalStateException: Graphics state stack should be empty at this point
显示 更早的评论
When running a matlab script that uses the print function, I receive the following error:
Error using print (line 82)
There was a problem while generating the output: Java exception occurred:
java.lang.IllegalStateException: Graphics state stack should be empty at this point
at org.apache.xmlgraphics.ps.PSGenerator.resetGraphicsState(Unknown Source)
at org.apache.xmlgraphics.ps.PSGenerator.showPage(Unknown Source)
at org.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D.writePageTrailer(Unknown Source)
at org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D.closePage(Unknown Source)
at org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D.finish(Unknown Source)
at com.mathworks.hg.print.FOPPSVectorStrategy.endJob(FOPPSVectorStrategy.java:212)
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:239)
Error in save_figs_to_pdf (line 38)
print(handle,'-dpsc2', tmpfile_ps, '-append', '-fillpage');
end
Any idea on the cause or how to fix it? The script continues to work on the computer it was written on, but doesn't seem to work on the several others tried. Is there some setting in MATLAB or the computers that could be adjusted to make this work?
1 个评论
Anand Patel
2017-12-27
Without complete reproduction steps, it would be hard to tell. You should contact Mathworks support about this.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Call Java from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!