GWT:将CellTable导出到图像或pdf文件

GWT:将CellTable导出到图像或pdf文件,gwt,celltable,gwt-celltable,Gwt,Celltable,Gwt Celltable,我有一个CellTable,显示在GFlot SimplePlot中绘制的数据 使用GFlots集成功能可以导出绘图: exportImage = plot.getImage(); 现在我也要导出CellTable,以向绘图显示相应的数据。 在客户端使用GWT时,这在某种程度上是可能的吗?它不需要是CellTable本身,只要显示数据就足够了。我认为您可以使用flash4j库: package com.emitrom.flash4j.demo.client; import com.e

我有一个CellTable,显示在GFlot SimplePlot中绘制的数据

使用GFlots集成功能可以导出绘图:

    exportImage = plot.getImage();
现在我也要导出CellTable,以向绘图显示相应的数据。
在客户端使用GWT时,这在某种程度上是可能的吗?它不需要是CellTable本身,只要显示数据就足够了。

我认为您可以使用flash4j库:

package com.emitrom.flash4j.demo.client;

import com.emitrom.flash4j.clientio.client.ClientIO;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;

public class ClientIOExample implements EntryPoint {
@Override
public void onModuleLoad() {
    // initialize the ClientIO module
    ClientIO.init();

    Button b = new Button("Click Me");
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            // create a PDF File
            PDF pdf = new PDF();
            pdf.addPage();
            pdf.setTextStyle(new RGBColor(0x000000));
            pdf.setFont(new CoreFont(), 10);
            pdf.addText("");
            ClientIO.saveFile(pdf.save(), "file.pdf");
        }
    });
    RootPanel.get().add(b);
}
}
您可以看到更详细的信息