// create an API client instance pdfcrowd.Client client = new pdfcrowd.Client("my username", "my api key");
// convert a web page and write the generated PDF to a memory stream MemoryStream Stream = new MemoryStream();
client.convertHtml("<head></head><body>My HTML Layout</body>", Stream);
// set HTTP response headers Response.Clear(); Response.AddHeader("Content-Type", "application/pdf"); Response.AddHeader("Cache-Control", "max-age=0"); Response.AddHeader("Accept-Ranges", "none"); Response.AddHeader("Content-Disposition", "attachment; filename=lol.pdf"); // send the generated PDF Stream.WriteTo(Response.OutputStream); Stream.Close(); Response.Flush(); Response.End(); }
The code is executed when a button is pressed and i can see that the HTTP POST method is successful. I was just wondering how to view the converted pdf / make it available to download
support
wrote on 2016-02-10:
Hello,
If you want to open the generated PDF in the browser, change
any further ideas on how i could get the download window to pop up would be really appreciated! :)
support
wrote on 2016-02-18:
Hello,
If you want to pop up the download dialog, the "attachment" version should do the trick. Could you please post a link to your page which demonstrates the issue?