Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have generated a barcode image in jpg format through code128 font and also printed it through argox printer..

my question is how to avoid skipping of stickers between two prints even after setting height and width of a page....



any suggestions pls?

C#
private void printpage(object sender, PrintPageEventArgs e)
{
    e.Graphics.PageUnit = gu;        //unit used is graphicunit.millimeter.
    e.PageSettings.PaperSize = new System.Drawing.Printing.PaperSize();
    e.PageSettings.PaperSize.Width = 75;
    e.PageSettings.PaperSize.Height = 15;
    System.Drawing.Image img = System.Drawing.Image.FromFile("C:/'" + barcode_txt + "'.jpg"); 
    e.Graphics.DrawImage(img, 135, 60);
    e.Graphics.DrawString(barcode_txt, newfont, Brushes.Black, 190, 70);
}
Posted
Updated 28-Oct-13 0:39am
v3
Comments
Richard MacCutchan 28-Oct-13 5:03am    
From the information provided it is impossible to guess what you may be doing. Please provide proper detail of your problem, including snippets of any failing code.
Member 7895843 28-Oct-13 5:33am    
private void printpage(object sender, PrintPageEventArgs e)
{
e.Graphics.PageUnit = gu; //unit used is graphicunit.millimeter.
e.PageSettings.PaperSize = new System.Drawing.Printing.PaperSize();
e.PageSettings.PaperSize.Width = 75;
e.PageSettings.PaperSize.Height = 15;
System.Drawing.Image img = System.Drawing.Image.FromFile("C:/'" + barcode_txt + "'.jpg");
e.Graphics.DrawString(barcode_txt, newfont, Brushes.Black,190,70);

}

This is the code am using to print the barcode image and text on a sticker of 35 mm * 15 mm size..
what am trying to ask is when i print the image and text are printed on the 8 sticker leaving seven stickers blank and if i again give the print command the print is done on 16 sticker instead of 9 sticker leaving seven stickers blank again in between...

thanks for the response.....
Richard MacCutchan 28-Oct-13 5:47am    
I don't see any code to draw the image, or to set its position on the page.
Member 7895843 28-Oct-13 6:28am    
private void printpage(object sender, PrintPageEventArgs e) {
e.Graphics.PageUnit = gu; //unit used is graphicunit.millimeter. e.PageSettings.PaperSize = new System.Drawing.Printing.PaperSize(); e.PageSettings.PaperSize.Width = 75; e.PageSettings.PaperSize.Height = 15; System.Drawing.Image img = System.Drawing.Image.FromFile("C:/'" + barcode_txt + "'.jpg");
e.Graphics.DrawImage(img,135,60);
e.Graphics.DrawString(barcode_txt, newfont, Brushes.Black,190,70);
}
Member 7895843 28-Oct-13 6:29am    
private void printpage(object sender, PrintPageEventArgs e) {
e.Graphics.PageUnit = gu; //unit used is graphicunit.millimeter. e.PageSettings.PaperSize = new System.Drawing.Printing.PaperSize(); e.PageSettings.PaperSize.Width = 75;
e.PageSettings.PaperSize.Height = 15; System.Drawing.Image img = System.Drawing.Image.FromFile("C:/'" + barcode_txt + "'.jpg");
e.Graphics.DrawImage(img,135,60);
e.Graphics.DrawString(barcode_txt, newfont, Brushes.Black,190,70);
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900