在WEB服务器上(UNIX)已经用POI或JXL生成好多个EXCEL。
EXCEL是标准的A4或A3大小,带图片,带公式。要求:
编程把这些EXCEL批量转化成PDF。
转换过程不能丢格式、图片,不需要手工操作。
EXCEL里的设置不能丢,比如有些表格表头是要求分页后每页都显示。

解决方案 »

  1.   

    crystal report 有 for eclipse 的版本,
    以前在 window下用过,可以输出pdf
      

  2.   

    我要的是这个意思
    现在现有的系统是用jxl和poi生成了EXCEL放在服务器,通过某种方式给客户
    在不改变原有系统的基础上,在生成EXCEL文件以后,
    调用某个包或者用命令行调用某个工具(注意:是在HP-UNIX下),把生成好的EXCEL转化成相应的PDF。
      

  3.   

    推荐一个技术吧,itext技术,应该可以搞定
      

  4.   

    给个链接
    http://www.matrix.org.cn/thread.shtml?topicId=35506&forumId=17
      

  5.   

    itext好像可以生成但是不能用EXCEL转化
      

  6.   

    服务器环境是HP-UNIX,VB写的东西能运行吗?
      

  7.   

    看来没什么希望阿,除非自己能把excel文件格式研究透了?微软的秘密怎么能让你知道阿 
    转换成pdf换一种思路:
    每页excel保存为一个图片,放到pdf中
      

  8.   

    每页excel保存为一个图片,放到pdf中
    也行
    只要是用程序实现,不用手工干预
      

  9.   

    看能不能使用PDFFactory等虚拟打印机,用打印的方法转换。
      

  10.   

    虚拟打印已经有了
    装Acrobat以后EXCEL中就有Acrobat的菜单,可以直接另存出来PDF
    问题是客户要求在服务器端生成PDF。
      

  11.   

    有个参考,不知道能不能用
    /*******************************************************************************
     * Copyright (c) 2000, 2005 IBM Corporation and others.
     * All rights reserved. This program and the accompanying materials
     * are made available under the terms of the Eclipse Public License v1.0
     * which accompanies this distribution, and is available at
     * http://www.eclipse.org/legal/epl-v10.html
     *
     * Contributors:
     *     IBM Corporation - initial API and implementation
     *******************************************************************************/
    package org.eclipse.swt.snippets;/*
     * Listen for events in Excel
     * 
     * For a list of all SWT example snippets see
     * http://www.eclipse.org/swt/snippets/
     */import org.eclipse.swt.SWT;
    import org.eclipse.swt.SWTError;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.ole.win32.*;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;public class Snippet199 {
        static String IID_AppEvents = "{00024413-0000-0000-C000-000000000046}";
        // Event ID
        static int NewWorkbook = 0x0000061d;
        static int SheetSelectionChange = 0x00000616;
        static int SheetBeforeDoubleClick = 0x00000617;
        static int SheetBeforeRightClick = 0x00000618;
        static int SheetActivate = 0x00000619;
        static int SheetDeactivate = 0x0000061a;
        static int SheetCalculate = 0x0000061b;
        static int SheetChange = 0x0000061c;
        static int WorkbookOpen = 0x0000061f;
        static int WorkbookActivate = 0x00000620;
        static int WorkbookDeactivate = 0x00000621;
        static int WorkbookBeforeClose = 0x00000622;
        static int WorkbookBeforeSave = 0x00000623;
        static int WorkbookBeforePrint = 0x00000624;
        static int WorkbookNewSheet = 0x00000625;
        static int WorkbookAddinInstall = 0x00000626;
        static int WorkbookAddinUninstall = 0x00000627;
        static int WindowResize = 0x00000612;
        static int WindowActivate = 0x00000614;
        static int WindowDeactivate = 0x00000615;
        static int SheetFollowHyperlink = 0x0000073e;    public static void main(String [] args) {
            Display display = new Display();
            Shell shell = new Shell(display);
            shell.setLayout(new FillLayout());
            OleControlSite controlSite;
            try {
                OleFrame frame = new OleFrame(shell, SWT.NONE);
                controlSite = new OleControlSite(frame, SWT.NONE, "Excel.Sheet");
                controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
            } catch (SWTError e) {
                System.out.println("Unable to open activeX control");
                return;
            }
            shell.open();        OleAutomation excelSheet = new OleAutomation(controlSite);
            int[] dispIDs = excelSheet.getIDsOfNames(new String[]{"Application"});
            Variant pVarResult = excelSheet.getProperty(dispIDs[0]);
            OleAutomation application = pVarResult.getAutomation();
            pVarResult.dispose();
            excelSheet.dispose();        int eventID = SheetSelectionChange;
            OleListener listener = new OleListener() {
                public void handleEvent(OleEvent e) {
                    System.out.println("selection has changed");
                    // two arguments which must be released (row and column)
                    Variant[] args = e.arguments;
                    for (Variant arg : args) {
                        System.out.println(arg);
                        arg.dispose();
                    }
                }
            };
            controlSite.addEventListener(application, IID_AppEvents, eventID, listener);        while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) display.sleep();
            }
            application.dispose();
            display.dispose();
        }
    }
      

  12.   

    TO sqlink
    谢谢你
    但是不是我要的
    我是有现成的生成EXCEL的模块
    我是要在生成EXCEL以后把生成的EXCEL在后台转换成PDF
      

  13.   

    能不能读取excel里的内容再生成pdf!!!!!!
    你可以自己实现,使用poi+itext来自己实现。
      

  14.   

    要么你找找看,找不找得到把Excel文件转换成FO文件的方法或开源工具,如果能找Excel转抱成FO类型的文件。