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

Free Support Forum - aspose.com

How can I name the pdf when clicking save in the browser

I am concatenating multiple pdfs into a single output file, that I output to the response.outputstream as follows. I do this on a page called "pdfviewer.aspx".

The question I have is, when I click save in the adobe reader within the browser, it defaults the name of the output file to pdfviewer.pdf. Is there a way to default the name to something dynamic when concatenating the files to be something more meaningful than the web page name as it is doing now?

//Instantiate PdfFileEditor object

PdfFileEditor pdfEditor = new PdfFileEditor();

//Call Concatenate method of PdfFileEditor object to concatenate all input streams into a single output stream

Response.ContentType = "application/pdf";

Response.AppendHeader("Accept-Ranges", "none");

pdfEditor.Concatenate(allFileStreams, Response.OutputStream);

Hi Mike,

You can try using the following statements to add header value:


//Add a new HTML header and value to the response sent to the client

Response.AddHeader(“content-disposition”,“inline; filename=” + “output.pdf”);


OR


//Add a new HTML header and value to the response sent to the client

Response.AddHeader(“content-disposition”,“attachment; filename=” + “output.pdf”);


However, I would like to add that different browsers might treat these names differently. Moreover, this is mostly related to the way the output is rendered to the browser using Response object, so you might discuss this further on MSDN forums etc.

If you have any further questions, please do let us know.
Regards,