VMI,
Sorry I meant page where I said form. I don't know of any examples
offhand on the web but I haven't had any problems printing bitmaps on a page
using PrintDocument.
For example the following puts a logo on the page if the logo file
exists on the disk and then sets the x location to just past the right hand
side of the logo.
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Printing;
using System.Xml;
if (System.IO.File.Exists(logoName)) // either specified or stock.
{
Image img = Image.FromFile(logoName);
e.Graphics.DrawImage(img, new PointF(98.0f, 56.5f));
xloc = 1.0f + (img.Width/img.HorizontalResolution) + 0.05f;
}
This puts it at the top left of the page for this form. In your case I
guess that you would just draw the whole thing at 0,0 but be aware that
things outside the printer's hard margins won't be shown.
Ron Allen
"VMI" <vo******@yahoo.com> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
The bitmap I'll be printing is an 8.5"X11" form. I don't really need to
display it in the Win Form; I just need to print it with the user
information. So I'm not really sure what you mean by that. Do you know of
any examples on the Web?
Thanks.
"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl... VMI,
You can use PrintDocument and just print the bitmap at the
appropriate
location on the form. Make sure to adjust for the printer's dpi settings
though or you will get stretching/shrinking effects on the background.
You can use DpiX and DpiY properties of the Graphics from the
PrintPageEventArgs argument to OnPrintPage to get the resolutions.
Ron Allen
"VMI" <vo******@yahoo.com> wrote in message
news:eA**************@TK2MSFTNGP15.phx.gbl... >I have a BMP image (the form is also in PDF) that contains a scanned
>copy
>of
> a paper form that we need to fill out. Is it possible to use this image in > my application so that the application can print out the form and the data > that the user entered? For example, the user loads the application and
> a
> normal Windows Form asks for the user's name. When the user enters the
> name
> and clicks on the "Print" button, I'd like to print the form in the jpg
> image and include the person's name in that form (in the appropriate
> position).
> I wanted to use a Windows Form (whose background would be the image), add > a
> textbox, and then print the Windows Form (with the txtbox that includes
> the
> user's name), but the Windows Form's size is limited to the screen
> resolution.
> Someone suggested using PrintDocument but I'm not sure if it'll be able to > accomplish this.
> Any suggestions are appreciated.
> Thanks.
> BTW, the PDF that contains the form is editable through Acrobat Reader (I > can type into it and print). Maybe that'll help me.
>
>