Sending an object from a web server to a client

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?

Answer №1

Have you thought about producing the PDF directly from the server and then allowing the user to download it?

Answer №2

Ask the customer to retrieve the base64 encoded array and then convert the information into a UCOMIStream object in order to create the PDF on their end.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Making a Cross-Origin Resource Sharing (CORS) request with jQuery utilizing the $

I am currently in the process of building a web application that relies heavily on data from multiple domains. Approximately 90% of the requests made by my application are cross-domain requests. However, I have encountered an issue where I am unable to re ...

What is the best method for starting a string using the symbol '~'?

Hello everyone! I have a task that requires me to add a special feature. The user needs to enter something in a field, and if it starts with the tilde (~), all subsequent entries should be enclosed in a frame within the same field or displayed in a list ...

The animation of react-circular-progressbar is experiencing a slight delay of one second

I managed to create a circular progress bar with a timer and a button that adds +10 seconds to the timer. However, I'm facing a 1-second delay in the animation of the progress bar when clicking on the button. If anyone could assist me in resolving t ...

Duplicate the Date object without retaining previous data

Struggling with creating a custom deep clone feature that's encountering issues with the Date object. For instance, let now = {time: new Date()} or let now = {data: new Date().getDay()}. When attempting to copy it, the goal is not to replicate the cur ...

What is the optimal approach for displaying numerous button components with varying values?

I've been developing a calculator in React and I decided to render all the buttons using the Button Panel component with what some might call a "brute force" method. return ( <> <div> <Button value="A/C" cl ...

Issue with Mobile Touch Screen Preventing Vertical Scrolling

Currently experiencing difficulties with a div element that is not allowing touch and vertical scroll on mobile devices. Although scrolling works fine with the mouse wheel or arrow keys, it does not respond to touch. Have tested this on various devices and ...

Using a React component to send data through a POST request to an API

When attempting to send a selected value from a Dropdown to an API using a POST request, I keep encountering a 405 (Method Not Allowed) error. Despite trying different ways to handle the onChange event, such as: onChange{(e) => this.onChangeHandler(e.t ...

Pulling a WooCommerce variable in PHP: A guide for JavaScript developers

I'm having some trouble executing PHP code that utilizes the WooCommerce variable to retrieve the order ID. add_action('add_meta_boxes', 'gen_order_meta_boxes'); function gen_order_meta_boxes() { add_meta_box( 'wo ...

Encountering errors while attempting to share files in a system built with Node.js, Express,

This snippet shows my Node.js code for connecting to a database using Mongoose const mongoose = require('mongoose'); function connectDB() { // Establishing Database connection mongoose.connect(process see your Naughty's you're sure ...

Is your AJAX loading indicator stuck?

One of the challenges I'm facing is trying to display an AJAX progress bar when a delete button is clicked. This button triggers various actions that take some time to process. The delete button is nested within a repeater element, and here's the ...

How can I display a nested dropdown list within a form using JSON data in React?

Utilizing material ui and formik, I have integrated a form that requires a selection box with nested options to be displayed as shown in the image linked here. (The value selected needs to be submitted upon form submission) https://i.sstatic.net/02AI2.png ...

Data retrieval takes precedence over data insertion

I'm facing an issue where I am trying to insert data into MySQL using Knex within a loop, but the data retrieval is happening before the insertion. Can anyone assist me with this problem? for (let i = 0; i < fileArray.length; i++) { fileLocation ...

Fetching the second item within an object using JavaScript

I am trying to retrieve the data from the last month of an API, but I want to avoid hard-coding the date like this: const data = [data.data['Monthly Time Series']['2021-11-30']]. I need a way to dynamically access the 2nd object without ...

Using an AJAX post request will result in receiving an HTML element, especially when an attachment is included with Paperclip

I've created an innovative application where users can share their stories through ajax submissions and engage with other readers by commenting on the stories using ajax as well. The technology stack I'm working with includes Rails 3.0.3, ruby 1. ...

How to replace the parent configuration for Eslint within a git submodule

My goal is to use eslint within my project, but the configuration is inheriting from the parent project. How can I prevent this and set up a separate pipeline for my core project, avoiding interference from other contributors? > <a href="/cdn-cgi/l ...

Creating a function to manipulate an element on a different webpage

Upon clicking a button on Page1, a function is triggered which then calls another function to generate HTML and append it to a div with the #lista id. The issue here is that #lista belongs to Page2, so I am unsure if there is a syntax similar to ajax where ...

Why is the system giving me an error in my c# code and how can I troubleshoot it?

((e.Values("NewsOn")))= DateTime.Now.ToString(); Issue 1 The property 'System.Web.UI.WebControls.DetailsViewInsertedEventArgs.Values' is not callable as a method. c:\Users\test\documents\visual studio 2012\WebS ...

Scenario-specific blueprints

I'm currently facing a challenge in incorporating logic into a dustjs template, and I find it challenging to integrate all the components seamlessly. Here is an example of the JSON data I have: { "names": [{ "name": "User 1", "is ...

Transform a string into an enumeration upon receiving an http request and automatically assign its value

Instead of converting a string to an Enum type using Enum.TryParse, I would like to directly convert it on the request's set property. Currently, I have an enum called SearchSortType and a class MyRequest with a property SortOn as a string. public en ...

ControlsContainer - jQuery object for Flexslider

I recently tried to implement a flexslider with controls in a separate div using the controlsContainer option provided by flexslider. The setup consists of a left column containing the slider code (".flexslider-small"), a right column with text, and the c ...