We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Draw image in background

Thread ID:





114649 Nov 29,2013 07:04 AM UTC Dec 9,2013 03:54 AM UTC ASP.NET MVC (Classic) 1
Tags: PDF
Jacob Saugmann
Asked On November 29, 2013 07:04 AM UTC


I'm just wondering how to draw an image in the background of the PDF?

when i use this code then the image is on top of header and footer in my PDF:

                var bgGraphics = page.Graphics;
                string bgImagePath = ResolveApplicationImagePath("kvrBackground.jpg");
                PdfImage bgImage = new PdfBitmap(bgImagePath);
                bgGraphics.DrawImage(bgImage, 0, 0, pdfDocument.PageSettings.Width, pdfDocument.PageSettings.Height);

have a nice day :-)

KarthikeyanC [Syncfusion]
Replied On December 9, 2013 03:54 AM UTC

Hi Jacob,

Thank you for using Syncfusion Products.


We can able to set the image as background, please use the below code snippet:


            PdfLoadedDocument ldDoc = new PdfLoadedDocument("Input.pdf");

            PdfDocument doc = new PdfDocument();


            for (int i = 0, count = ldDoc.Pages.Count; i < count; ++i)


                PdfPageBase page = doc.Pages.Add();

                PdfGraphics g = page.Graphics;


                PdfPageBase lpage = ldDoc.Pages[i];

                PdfTemplate template =  lpage.CreateTemplate();


                PdfImage img = new PdfBitmap("Image.gif");

                g.DrawImage(img, new PointF());

                g.DrawPdfTemplate(template, PointF.Empty, page.Size);





Please let us know if you need any further assistance.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon