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. 5 3425
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.
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.
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. > >
Thanks. I works but I don't know how to insert the values into the image.
The values come from the application. Is that possible?
"Ron Allen" <rallen@_nospam_src-us.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl... 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. > >
VMI,
Just draw them at the appropriate location on the page. I use
XmlDocument items to pass my data around. Just put them into an appropriate
XML structure and when you print the page just grab them out of the
structure with SelectSingleNode. Draw them at the appropriate location
using DrawString and the font desired.
You may want to get a copy of Programming Windows in C#/VB.NET by
Petzold as he discusses basic printing there. Or look at some of the
printing examples at www.gotdotnet.com or www.codeproject.com.
Ron Allen
"VMI" <vo******@yahoo.com> wrote in message
news:uJ**************@tk2msftngp13.phx.gbl... Thanks. I works but I don't know how to insert the values into the image. The values come from the application. Is that possible?
"Ron Allen" <rallen@_nospam_src-us.com> wrote in message news:uz**************@TK2MSFTNGP10.phx.gbl... 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. >> > >> > >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Carlos Kirkconnell |
last post by:
When printing, there is a definition for a Custom paper size, the custom
paper size can be setted programatically and everything is supposed to work
normally. But in windows 2000 and xp, the user...
|
by: lavu |
last post by:
I currently have a C# windows Application . I would like this App to
work through an command line interface also. I would like to specify
command line params, which should start the app and process...
|
by: Daniel |
last post by:
Hello!
I am having a problem with a windows application that abnormally terminates
itself. The application is a multi threaded .NET 1.1 application, and can
briefly be described as follows:
...
|
by: Rodo |
last post by:
Hi all,
We have a "testing report" form at work that we fill with data (typing for
now). The form has a table, other lines and a company logo. I can make a
windows form that will get the data...
|
by: yogeshtiwarijbp |
last post by:
Hi All
I have a resume upload application which is a web application. I have to done load testing on that application. For that i have to create a windows application and create multiple instances...
|
by: arora.dipti |
last post by:
Hi,
I am having a windows application in which i have one windows form
which derives from one base form.the base form has some controls whose
tabindex is set there in the form.
In my derived form...
|
by: Sport Girl |
last post by:
Hi everybody, please can anybody give me a hand in this issue:
I cannot find the way how to redirect to an another form in Windows Application. What should I write in the code??
|
by: Drew Riegler |
last post by:
I am building an app that requires printing of multiple paper forms for each record in a csv text file (could easily be MS Access or mySQL table rows). Each row in the csv file represents a patient...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |