Hi all, I am having some problems dealing with PDFs.
1) I have DynamicWebResource (MyPdfDynamicWebResource) that overrides the
getResourceState() method as follows.
protected ResourceState getResourceState() {
return new ResourceState() {
protected byte[] myPDF;
public String getContentType() {
return "application/pdf";
}
public Time lastModifiedTime() {
return Time.now();
}
public byte[] getData() {
return basicGetData();
}
protected synchronized byte[] basicGetData() {
if (myPDF== null) {
myPDF = generatePDF();
}
return myPDF;
}
public int getLength() {
return basicGetData().length;
}
};
}
2) I have a MyForm extension (simple) that has the following onSubmit()
code:
public void onSubmit() {
Resource cResource = new MyPdfDynamicWebResource();
cResource.onResourceRequested();
}
3) Saddly )*This works perfect on IE 7, but does not work on Firefox and
Safari.*
My goals:
1) Open the PDF file in a new window for the purpose of NOT losing the User
input data on the form and the page that the user was on.
2) The opening of the PDF inside the browser is kind of optional.
Hopefully you'll be able to help me,
cheers,
f(t)