I would like to know if it is possible to force a "Save As" dialog box when generating a PDF via a ConvertURL() call. When I use the RenderAsPDF() call to render page contents as a PDF it generates a "Save As" dialog box, but it doesn't do that when I use the ConvertURL() call.
Process that I would like to happen:
1. Click a Button on page 1
2. Request contents from page 2
3. Get the contents and put into pdf
3. Stay on page 1 and see a view/save dialog
What Actually happens now:
1. Click a Button
2. Opens pdf in pdf viewer
Here is the code that I'm trying:
Code: C#
protected void Button1_Click(object sender, EventArgs e)
{
//Convert to the output stream
EO.Pdf.PdfDocument doc = new EO.Pdf.PdfDocument();
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearHeaders();
response.ContentType = "application/pdf";
EO.Pdf.HtmlToPdf.ConvertUrl("www.abc.com/page2.aspx", doc );
doc.Save(Response.OutputStream);
response.End();
}
I also tried to do something like this:
Code: C#
protected void Button1_Click(object sender, EventArgs e)
{
//Convert to the output stream
EO.Pdf.PdfDocument doc = new EO.Pdf.PdfDocument();
EO.Pdf.HtmlToPdf.ConvertUrl("www.abc.com/page2.aspx", doc );
//Save the PDF file
doc.Save(Path.GetTempPath() + "test.pdf");
}
Thanks in advance for your help!