1: protected void btnConvert_Click(object sender, EventArgs e)
2: {
3: PdfConverter pdfConverter = new PdfConverter();
4:
5: pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
6: pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
7: pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
8:
9:
10:
11: pdfConverter.PdfDocumentOptions.ShowFooter = false;
12: pdfConverter.PdfDocumentOptions.ShowHeader = false;
13:
14: pdfConverter.LicenseKey = "MyLicenseKeyString";
15:
16: byte[] downloadBytes = pdfConverter.GetPdfBytesFromRtfString(MyRTFString);
17:
18: System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
19: response.Clear();
20: response.AddHeader("Content-Type", "binary/octet-stream");
21: response.AddHeader(
"Content-Disposition",
22: "attachment; filename=" + "Rendered.pdf" + "; size="
+ downloadBytes.Length.ToString());
23: response.Flush();
24: response.BinaryWrite(downloadBytes);
25: response.Flush();
26: response.End();
27: }