Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1028

Export a blank file throws an IOException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.8.0.FL
    • 3.7.0
    • None
    • None

      Steps to reproduce

      1. load a blank xlsx file
      2. 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.

            henrichen henrichen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: