Appendix A

Java code for multi-page image output


// This exampleassumes that the output format is JPG.
//ProcessImage.getPages() returns an array of byte arrays. Each byte array is onepage.
if (report instanceofProcessImage) {
  ProcessImage procImage = (ProcessImage)report;
  if (procImage.getPages() != null) {
     for (int i = 0; i
        byte[] page =procImage.getPages().get(i);
        String filename ="outputImage_" + Integer.toString(i) + ".jpg";
        FileOutputStream stream = newFileOutputStream(filename);
        stream.write(page);
        System.out.println("HTML pagewritten to " + filename);
        stream.close();
     }
  }
}

For over 10 years Windward has been making software that allows business users and developers to create data-powered reports, proposals, statements, and more within Microsoft Word, Excel, and PowerPoint environments with scalable high-performance output engines written for .NET, Java, and RESTful applications. Windward is proudly located in Boulder, Colorado serving over 70 countries around the world.

Contact

Got questions about reporting and document generation? We've got answers—let's connect!
Send a note