views:

161

answers:

2

Here's the JavaScript (on an aspx page):

function WriteDocument(clientRef, system, branch, category, pdfXML)
{        
    AppletReturnValue = document.DocApplet.WriteDocument(clientRef, apmBROOMS, branch, category, pdfXML);
    if (AppletReturnValue.length > 0) {
        document.getElementById('pdfData').value = "";
        CallServer(AppletReturnValue,'');
    }
    PostBackAndDisplayPDF()
}

pdfXML is got from pdfData which is a hidden field on the page containing the XML that contains base64 encoded pdf data which is passed to the java applet. All the other values being passed have within range sensible values.

The XML is like this

<Documents>
   <FileName>AFileName</FileName>   
   <PDF>JVBERiDAzOTY1NzMwIDAwMDAwIG4NCjAwMDM5NjU4NDcgMDAwMDAgbg0KMDAwMzk2NTk2</PDF>
</Documents>

The contents of the element PDF is a lot bigger than displayed here

The signature of the Java method is:

public String WriteDocument(String clientPolicyReference,
                                       int systemType,
                                       int branch,
                                       String category,
                                       String PDFData) throws Exception

It seems that when the size of the PDF data gets large the applet fails to be called and the error 'Unknown Error' is thrown in the JS.

The PDF doc the data of which is producing this error is about 4Mb in size.

Many thanks in advance for any help.

A: 

Thanks for responding chaps but I've sorted the problem.

How? I took JRE 1.6 update 12 off and stuck update 7 (which is the version we reccomend to those who use our website) on my machine.

Why update 12 stopped working I don't know. Why update 7 is stable I don't know. [sigh]

It's things like this that make me glad I work mostly with a 'long time between releases' framework like .net.

A: 

Hi, I have a similar issuea in my application, I'm sending big PDF as base64 data to my applet and it seems to work only for files with 3.5MB max file size, the other files that have more than 10MB seems to be ignored or truncated... I tried to do what you did downgrading my JRE to 1.6_07 but it still didn't work... do you have another aproach... in your case your application is working ok for this solution?

Luiz H Grossl