Welcome Guest Search | Active Topics | Sign In | Register

MVC to PDF Options
peterf
Posted: Wednesday, April 1, 2015 8:29:09 PM
Rank: Newbie
Groups: Member

Joined: 4/1/2015
Posts: 1
How can I add a cookie when downloading the pdf generated from MVCtoPDF?
Code: C#
eo_support
Posted: Thursday, April 2, 2015 12:46:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

You won't be able to send the cookie and PDF file to the client on the same request. So it has to be separate requests. For example, you can code to implement this logic:

1. User click "Convert to PDF" button;
2. Inside your button handler you set the cookie. The response carries the cookie to the client side;
3. The client side JavaScript automatically post the page and raises another server event;
4. Inside that server event you would convert to the PDF and send the result to the client;

Note that here step 2 and step 4 are two different responses. The cookies are sent to the client on step 2 and the PDF is sent to the client on step 4. Step 3 is used to chain them together.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.