|
-
December 24th, 2009, 05:46 PM
#1
C# printing problem
Hello all,
I am presently having a problem with printing in C#.
The problem is my customer provided me a pre printed paper and I
need to print value into some specific positions. But problem is C# for its
generic autofit to page nature dont let me doing this. Every time it is
decreasing whole page's size and also altering my value position into some
specific ratio. Can anyone tell me how can I come over that problem.
This is my code
Code:
# //I AM USING PrintDocument COMPONENT
# private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
# {
# //panelPrintData IS A PANEL CONTAING MY PRINTING PICTUREBOX,TEXTBOX,COMBO AND OTHERS NEED TO PRINT
# printDoc(panelPrintData, e);
# }
#
#
# public void printDoc(Panel p,PrintPageEventArgs e)
# {
# try
# {
# foreach (object obj in p.Controls)
# {
# if (obj is TextBox)
# {
# TextBox txt = (TextBox)obj;
# e.Graphics.DrawString(txt.Text, new Font("Arial", 10, FontStyle.Regular), Brushes.Black, txt.Left , txt.Top );
#
# }
# if (obj is Utility.LSInterfaces.IImagePrintable)
# {
# Utility.LSInterfaces.IImagePrintable img = (Utility.LSInterfaces.IImagePrintable)obj;
# e.Graphics.DrawImage(img.Picture, img.Left , img.Top , img.Width, img.Height);
#
# }
# if (obj is LogiSoftUserControl.ResizableComponent.ResizablePictureBox)
# {
# LogiSoftUserControl.ResizableComponent.ResizablePictureBox img = (LogiSoftUserControl.ResizableComponent.ResizablePictureBox)obj;
# e.Graphics.DrawImage(img.Picture, img.Left , img.Top , img.Width, img.Height);
#
# }
# if (obj is PictureBox)
# {
# PictureBox img = (PictureBox)obj;
# e.Graphics.DrawImage(img.Image, img.Left , img.Top , img.Width, img.Height);
#
# }
# }
# }
#
# catch (ArgumentNullException)
# { }
#
#
# }
#
#
# //THIS IS BUTTON FOR PRINT
# private void btnPrint_Click(object sender, EventArgs e)
# {
# DialogResult r = printDialog1.ShowDialog();
# if (r == DialogResult.OK)
# printDocument1.Print();
# }
-
December 25th, 2009, 11:44 PM
#2
Re: C# printing problem
The problem is my customer provided me a pre printed paper and I
need to print value into some specific positions.
Wouldn't it be easier to use the printer in RAW mode and use PCL commands to position the printing??? This would give you total control over print positioning.
-
December 26th, 2009, 04:04 AM
#3
Re: C# printing problem
Actually If you can provide me some codes, that will be very helpful.
Thanks.
-
December 26th, 2009, 05:04 PM
#4
Re: C# printing problem
 Originally Posted by babaidebnath
Actually If you can provide me some codes, that will be very helpful.
Thanks.
Check this link out.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|