-
Bug
-
Resolution: Fixed
-
Normal
-
3.7.0
-
None
-
None
Steps to reproduce
- load a blank xlsx file
- export it as a PDF like
File file = new File(currentFoler+ss.getBook().getBookName()+".pdf"); System.out.println(file.getAbsolutePath()); FileOutputStream fos = new FileOutputStream(file); //shall get exporter for each exporting Exporters.getExporter("pdf").export(ss.getBook(), fos); Filedownload.save(file, "application/excel");
Actual Result
ExceptionConverter: java.io.IOException: The document has no pages.
at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)
at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
at com.lowagie.text.Document.close(Unknown Source)
at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:272)
at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at bsh.Reflect.invokeMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.BSHPrimarySuffix.doName(Unknown Source)
at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHBlock.evalBlock(Unknown Source)
at bsh.BSHBlock.eval(Unknown Source)
at bsh.BshMethod.invokeImpl(Unknown Source)
at bsh.BshMethod.invoke(Unknown Source)
at bsh.BshMethod.invoke(Unknown Source)
at bsh.Name.invokeLocalMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:133)
at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328)
at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:900)
Expected result
a friendly message "Spreadsheet find nothing to print" or just export one blank page.