After creating a C# web application that calls a web-service returning a base64 encoded array (PDF file), I convert the array to a UCOMIStream object to comply with the DLL parameters. The code for this conversion works flawlessly, allowing me to print the PDF through the DLL.
While this process functions perfectly on the Webserver, the goal is to print the PDF locally.
Byte[] bBuffer = statementOut.statementcycle.statementdata.content;
int size = bBuffer.Length;
IntPtr mem = Marshal.AllocHGlobal(size);
Marshal.Copy(bBuffer, 0, mem, size);
// Create an OLE Stream object.
System.Runtime.InteropServices.UCOMIStream str; //obsolete but the createstreamonhglobal outputs it
CreateStreamOnHGlobal(mem, true, out str);
Since the DLL is located on the client side, I attempted to use ActiveX with javascript and/or VBscript to create the object. However, I have been unsuccessful in finding a way to pass the stream object to the client for use with the DLL.
What would be the best approach to achieve this?