mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

Printing text over an imported Image

Mar 22 2012 8:49 AM
Guys i have an app that generates an invoice and does the job for printing fine, but I would like to send the invoice direct to a PDF, now i can do this with no problems, but my point is i would like to draw in an image from my resources place it in the background then print textfields over the top as when using PDF option the background is white with just text(as you would expect.) because in a printer it would be on invoice paper.

I'm using code as below in my print doc, theres more but that's just an example of how i'm rendering the invoice from the form:

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
                //maybe do something here to import background image then print below over the top?
                              
                using (Font font = new Font("Arial", 10))
                e.Graphics.DrawString(companynameTextBox.Text, font,
                SystemBrushes.WindowText, e.PageBounds.X + 80, 240);

                using (Font font = new Font("Arial", 10))
                e.Graphics.DrawString(address_1TextBox.Text, font,
                SystemBrushes.WindowText, e.PageBounds.X + 80, 260);
         }


Answers (2)