1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
protected nietige btnPrint_Click (objecten afzender, EventArgs e) { Document doc. = nieuw Document (); doc.SetPageSize (PageSize.A4.Rotate ()); doc.NewPage (); De schrijver van PdfWriter = PdfWriter.GetInstance (doc., Response.OutputStream); Response.ContentType = „toepassing/pdf“; Response.AddHeader („tevreden-Regeling“, „gehechtheid; filename=Myfile“ + lblDate.Text + „.pdf“); doc. Open (); iTextSharp.text.Rectangle pagina = doc.PageSize; //date Paragraaf p = nieuwe Paragraaf (lblDate.Text, nieuwe iTextSharp.text.Font (iTextSharp.text.Font.DEFAULTSIZE, 12f)); p.Alignment = 1; //this is richt zich aan centrum doc. Voeg toe (p); //logo iTextSharp.text.Image embleem = iTextSharp.text.Image.GetInstance (Request.MapPath („~/images/logoPDF.jpg“)); embleem. Groepering = iTextSharp.text.Image.ALIGN_LEFT; logo.ScalePercent (20f); doc. Voeg toe (embleem);