import com.jxcell.CellException; import com.jxcell.View; import java.io.IOException; public class PdfPrint { public static void main(String args[]) { View m_view = new View(); Clocker clock = new Clocker(); try { m_view.read(".\\book.xls"); m_view.setPrintScale(100); // set print scale value --- default is 100% m_view.setPrintHeader("Your header"); //set header --- default is &A m_view.setPrintFooter("Your footer"); //set footer --- default is Page &P m_view.setPrintGridLines(true); //show grid line m_view.write(".\\1.pdf",View.eFilePdf); //export to pdf file clock.output("write pdf ok"); } catch (CellException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }