Imorimante et impression

creanova2000 Messages postés 39 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 21 septembre 2006 - 7 oct. 2003 à 06:54
creanova2000 Messages postés 39 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 21 septembre 2006 - 8 oct. 2003 à 06:13
bonjour
je suis en train de faire une application qui me permettera d'imprimer des etiquette de taille largeur= 125mm et de hauteur= 75mm .
j'arrive a imprimer mes donneer correctement le probleme c'est apres avoir imprimer l'imprimante (Matrice) avance a peur pre 2 etiquette et demi ce qui veut dire que l'imprimante commencera la prochaine impression a la moitie de l'etiquette no 4.

ce que je veux faire c'est qu'apres avoir imprimer les donnes l'mprimante doit s'arreter au debut du second tiquest j'usqu'a qu'elle a l'ordre d'imprimer le second tiquet

desoler pour la longue explcation
mais c'est tres tres urgent

merci de l'aide.

4 réponses

TheSaib Messages postés 2367 Date d'inscription mardi 17 avril 2001 Statut Membre Dernière intervention 26 décembre 2007 23
7 oct. 2003 à 17:08
A mon a vis cela n'a rien a voir avec ton programme mais avec la definition du format de tges etiquettes , tu ne dois pas avoir definit le format adequat a ton imprimante

::|The S@ib|::
MVP C#.NET
0
creanova2000 Messages postés 39 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 21 septembre 2006 5
8 oct. 2003 à 00:49
quand je vais aux proprietes de l'imprimante :
elle ne supporte que les format suivants:
A4, A5, letter, legal
je pense que je dois definir les proprirtes du format manuellemant si c'est le cas s'il vou plait est ce que vous pouvez me donner un coup de main.

merci.
0
TheSaib Messages postés 2367 Date d'inscription mardi 17 avril 2001 Statut Membre Dernière intervention 26 décembre 2007 23
8 oct. 2003 à 01:22
Si l'imprimante ne le gere pas ya peu de chance que tu puisse definir un format particulier ...

Je craint ne pouvoir t'aider sur ce coup ci
::|The S@ib|::
MVP C#.NET
0
creanova2000 Messages postés 39 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 21 septembre 2006 5
8 oct. 2003 à 06:13
voici un bout de mon code:
peu etre nous pourrons trouver un solution a ca

Quand j'execute le code suivat
une erreur se produit ave c le message suivat:
" Can't change size unless kind is set to Custom"

alors la prmiere question c'st comment je met la propriete
Kind a Custom.

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.PageSettings.PaperSize.Kind.Equals(pk);
e.PageSettings.PaperSize.Height= 2;
// Determine the height of the header, based on the selected font.

float headerHeight = headerFont.GetHeight(e.Graphics);

// Determine the number of lines of body text that can be printed per page, taking

// into account the presence of the header and the size of the selected body font.

float linesPerPage = (e.PageBounds.Height - headerHeight)/ bodyFont.GetHeight(e.Graphics);

// Used to store the position at which the next body line
// should be printed.
float yPosition = 0;
float yPosition2 = 0;
float yPosition3 =0;
float yPosition4 =0;
float yPosition5 =0;
float yPosition6 =0;
float yPosition7 =0;
float yPosition8 =0;
float yPosition9 =0;
float yPosition10 =0;

// Used to store the number of lines printed so far on the
// current page.
int count = 0;

// User to store the text of the current line.
string line = null;

// Print the page header, as specified by the user in the form.
// Use the header font for this line only.
e.Graphics.DrawString("FABRICOLOUR", headerFont, Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top, new StringFormat());
// Determine the position at which to print. Since this report prints one line
// at a time, only the height (or Y coordinate) needs to be calculated, because
// every line will begin at the far left. The Y coordinate must take into
// consideration the header, the height of each line of body text, and the
// number of body lines printed so far on this page.

yPosition = e.PageBounds.Top + headerHeight + (count * bodyFont.GetHeight(e.Graphics));
yPosition2= e.PageBounds.Top + headerHeight + (2 * bodyFont.GetHeight(e.Graphics));
yPosition3= e.PageBounds.Top + headerHeight + (4 * bodyFont.GetHeight(e.Graphics));
yPosition4= e.PageBounds.Top + headerHeight + (6 * bodyFont.GetHeight(e.Graphics));
yPosition5= e.PageBounds.Top + headerHeight + (8 * bodyFont.GetHeight(e.Graphics));
yPosition6= e.PageBounds.Top + headerHeight + (10 * bodyFont.GetHeight(e.Graphics));
yPosition7= e.PageBounds.Top + headerHeight + (12 * bodyFont.GetHeight(e.Graphics));
yPosition8= e.PageBounds.Top + headerHeight + (14 * bodyFont.GetHeight(e.Graphics));
yPosition9= e.PageBounds.Top + headerHeight + (16 * bodyFont.GetHeight(e.Graphics));

// Draw the line of text on the page using the body font specified by the user.
e.Graphics.DrawString("FABRICOLOUR ", myfont1, Brushes.Black, e.PageBounds.Left + 90, e.PageBounds.Top -2 , new StringFormat());

e.Graphics.DrawString("Bill To : ", bodyFont, Brushes.Black,

e.PageBounds.Left - 3, yPosition + 10 , new StringFormat());

e.Graphics.DrawString("" +lbl_chargeto.Text+"", headerFont, Brushes.Black, e.PageBounds.Left + 100 , yPosition + 4 , new StringFormat());

e.Graphics.DrawString("Ship To : ", bodyFont, Brushes.Black, e.PageBounds.Left - 3, yPosition2 - 6, new StringFormat());

e.Graphics.DrawString("" +lbl_shipto.Text+" ", headerFont, Brushes.Black, e.PageBounds.Left + 100 , yPosition2 -11, new StringFormat());

e.Graphics.DrawString("Dye Lot# : ", bodyFont, Brushes.Black, e.PageBounds.Left - 3, yPosition3 - 6 , new StringFormat());

e.Graphics.DrawString("" +lbl_lotnumber.Text+" ", headerFont, Brushes.Black, e.PageBounds.Left + 100 , yPosition3 - 12, new StringFormat());

e.Graphics.DrawString("Style # : ", bodyFont, Brushes.Black, e.PageBounds.Left - 3, yPosition4 - 6 , new StringFormat());

e.Graphics.DrawString("" +txtstyle.Text+" ", bodyFont, Brushes.Black, e.PageBounds.Left + 100, yPosition4 - 6 , new StringFormat());

e.Graphics.DrawString("Width: ", bodyFont, Brushes.Black, e.PageBounds.Left + 180, yPosition4 - 6 , new StringFormat());

e.Graphics.DrawString("" +txtf_width.Text+" ", bodyFont, Brushes.Black, e.PageBounds.Left + 240, yPosition4 - 6 , new StringFormat());

e.Graphics.DrawString("Blend : ", bodyFont, Brushes.Black, e.PageBounds.Left, yPosition5 - 6, new StringFormat());

e.Graphics.DrawString("" +lbl_content.Text+" ", bodyFont, Brushes.Black, e.PageBounds.Left + 100, yPosition5 - 6 , new StringFormat());

e.Graphics.DrawString("Col.Name : ", bodyFont, Brushes.Black, e.PageBounds.Left, yPosition6 - 6, new StringFormat());

e.Graphics.DrawString("" +lbl_colourname.Text+" ", bodyFont, Brushes.Black, e.PageBounds.Left + 100, yPosition6 - 6 , new StringFormat());

e.Graphics.DrawString("Col. #: ", bodyFont, Brushes.Black, e.PageBounds.Left + 180, yPosition6 - 6 , new StringFormat());

e.Graphics.DrawString("" +lbl_colournumber.Text+" ", bodyFont, Brushes.Black, e.PageBounds.Left + 240, yPosition6 - 6 , new StringFormat());

e.Graphics.DrawString("Roll. # : ", bodyFont, Brushes.Black, e.PageBounds.Left, yPosition7 - 6 , new StringFormat());

e.Graphics.DrawString("" +txtp_no.Text+" ", headerFont, Brushes.Black, e.PageBounds.Left + 100, yPosition7 - 12 , new StringFormat());

e.Graphics.DrawString("Kgs : ", bodyFont, Brushes.Black, e.PageBounds.Left, yPosition8 - 6 , new StringFormat());

e.Graphics.DrawString("" +txtf_wght.Text+" ",headerFont, Brushes.Black, e.PageBounds.Left + 100, yPosition8 - 12 , new StringFormat());

e.Graphics.DrawString("Mts : ", bodyFont, Brushes.Black, e.PageBounds.Left + 180, yPosition8 - 6 , new StringFormat());

e.Graphics.DrawString("" +txtmts.Text+" ", headerFont, Brushes.Black, e.PageBounds.Left + 240, yPosition8 - 12, new StringFormat());

// Increment the counter to show that another line has been printed.
// This is used in the positioning of future lines of text on the current page.

count++;

}

public void printing()
{

printDocument1.PrinterSettings.DefaultPageSettings.Margins.Left= 0;

printDocument1.PrinterSettings.DefaultPageSettings.Margins.Right= 7;

printDocument1.PrinterSettings.DefaultPageSettings.Margins.Top= 7;

printDocument1.PrinterSettings.DefaultPageSettings.Margins.Bottom= 7;

printDocument1.Print();

}
0
Rejoignez-nous