First of all, read all comments to your question. Secondly, be careful with code context and do not use objects that without a context.
Try this:
private void button1_Click(object sender, EventArgs e)
{
PdfDocument pdf = new PdfDocument();
PdfPage pg = pdf.AddPage();
XGraphics grp = XGraphics.FromPdfPage(pg);
grp.MUH = PdfFontEncoding.Unicode;
grp.MFEH = PdfFontEmbedding.Default;
XFont ft = new XFont("Microsoft Sans Serif", 15, XFontStyle.Bold);
grp.DrawString("Hazardous Situation or Incident Record", ft, XBrushes.LightGreen, new XRect(0, 0, pg.Width.Point, pg.Height.Point), XStringFormats.TopCenter);
string pdffilename = "Hazardous situation(or)Incident Record";
XPen pn = new XPen(XColors.Blue, 2);
grp.DrawLine(pn, 2, 80, 612, 80);
pdf.Save(pdffilename);
Process.Start(pdffilename);
}