Thank you Thomas,
Help on this is greatly appreciated.
It is working fine in my local test.
But still I am getting error. Please see attachment.
Below is my code line where I am getting this error.
Code:
PdfDocument document = new PdfDocument();
document.Info.Title = "A sample invoice";
document.Info.Subject = "Demonstrates how to create an invoice.";
document.Info.Author = "Stefan Lange";
// Create an empty page
PdfPage page = document.AddPage();
[color=#408040] // Get an XGraphics object for drawing
XGraphics gfx = XGraphics.FromPdfPage(page); //This line has an error
[/color]
//XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
// Create a font
XFont font = new XFont("Times New Roman", 14, XFontStyle.BoldItalic);
gfx.DrawString(footer, new XFont("Times New Roman", 8, XFontStyle.BoldItalic), XBrushes.Black, x, y, XStringFormats.TopLeft);
MemoryStream stream = new MemoryStream();
document.Save(stream, false);
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", stream.Length.ToString());
Response.BinaryWrite(stream.ToArray());
Response.Flush();
stream.Close();
Response.End();