I use the code below. The PDF_HOST_URL variable is the url to my local servlet. downloadFrame is a GWT Frame object.
pdfService.storeFormInSession(form, new AsyncCallback<EfPdfData>() {
public void onSuccess(EfPdfData arg0) {
RootPanel.get().remove(downloadFrame);
downloadFrame.setUrl(PDF_HOST_URL);
downloadFrame.setVisible(false);
RootPanel.get().add(downloadFrame);
downloadFrame.addLoadHandler(new LoadHandler() {
public void onLoad(LoadEvent arg0) {
waitDialog.hide();
}
});
new ReadyStateWatch(downloadFrame, waitDialog).addReadyStateChangeHandler(
new ValueChangeHandler<ReadyState>() {
public void onValueChange(ValueChangeEvent<ReadyState> event) {
}
});
}
public void onFailure(Throwable exception) {
new EfDialog(exception.getMessage()).show();
waitDialog.hide();
}
});