Hi All

In our web application, we needed to capture a DIV element to a pdf file and save it on the server. The DIV element is already a custom DataFlex/JavaScript web class.

We're using the jsPDF library to generate the pdf file, which can preview and save but this is on the client machine where the browser is running. The library can generate a base64 string of the pdf file, note the files on average are 350kb which will break the string argument size, so I want to deal with the string on the DataFlex side as a UChar Array.

Now we have a base64 string in our custom web control in Javascript, how do we upload to the server... how?

1. Web Property

I am not sure how to define a UChar array in the Javascript side, are there any examples?

Normally I just define them as..

Code:
this.prop(df.tString, "psMY_DataFlex_Property", "");
2. serverAction method

I tried sending an array as an argument on a serverAction call, but I got an error that arguments can only be simple types.

3. ValueTree

In the end we got it working by using a Value Tree, similar to using ProcessDataSets in a cWebList. The base64 string ends up back in DataFlex in a struct array of strings that was split into 65000 byte chunks, then converted to a UChar array and written out to disk.