We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Pdf.Save() Ends Response?

Hello,

I’m using the following overloaded Pdf.Save() method:

public void Save(
string *fileName*,
SaveType *saveType*,
HttpResponse *response*
);

As expected, it sends the report to the Browser, however after doing so, it disregards all of my other changes to the page that is posting back to cause this .Save to be called. Is this the expected functionality?

The scenario I’m looking for is this:

  1. User performs an action on the screen which causes a postback.

  2. On postback, the screen is modified - textboxes cleared, datagrid bound, etc. - and a PDF is created and saved using Pdf.Save(Filename, SaveType, HttpResponse).

  3. When complete, user gets prompted to save/open the Pdf, and the screen is changed based on the things that happened on postback.

What is happening is this:

  1. User performs an action on the screen which causes a postback.

  2. On postback, the screen is modified - textboxes cleared, datagrid bound, etc. - and a PDF is created and saved using Pdf.Save(Filename, SaveType, HttpResponse).

  3. When complete, user gets prompted to save/open the Pdf, and the screen remains unchanged.

Thank you,

-Matt

Hi Matt,

Thank you for considering Aspose.

I'm not sure how to support your requirement. But you can try saving the PDF into a stream and put the stream to browser by yourself so you can control the behavior of browser on detail. Working on this way Aspose.Pdf will only generate a PDF stream for you.