Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# crypto client/server problem Pin
OriginalGriff22-Jun-09 6:14
mveOriginalGriff22-Jun-09 6:14 
QuestionHow to Determine the path of .msi file? Pin
Narendra Reddy Vajrala18-Jun-09 5:26
Narendra Reddy Vajrala18-Jun-09 5:26 
AnswerRe: How to Determine the path of .msi file? Pin
MumbleB18-Jun-09 19:50
MumbleB18-Jun-09 19:50 
QuestionCheck to se if user is logged on Pin
precious roy18-Jun-09 4:47
precious roy18-Jun-09 4:47 
AnswerRe: Check to se if user is logged on Pin
dan!sh 18-Jun-09 5:01
professional dan!sh 18-Jun-09 5:01 
GeneralRe: Check to se if user is logged on Pin
precious roy18-Jun-09 5:17
precious roy18-Jun-09 5:17 
GeneralRe: Check to se if user is logged on Pin
dan!sh 18-Jun-09 5:54
professional dan!sh 18-Jun-09 5:54 
QuestionProblem between e.Graphics.DrawString() and PrintDirect Pin
totoprog18-Jun-09 4:25
totoprog18-Jun-09 4:25 
Hello,

In my application, I want to print some informations.

I can print this informations with e.Graphics.DrawString () .

The problem that I want to print in the same page ,that contains informations printed with e.Graphics.DrawString () I want to print command PCL but the problem is that I have in the result 2 pages.

- the first one contains informations printed with e.Graphics.DrawString ().
- The second contains informations of PCL command

The problem that I want in the result 1 page that contains both information.

I send To you a part of my code:

code use e.Graphics.DrawString ():
PrintDocument Page = new PrintDocument(); Page.PrintPage += new PrintPageEventHandler(cardDocument_Page); Page.Print();


Code of cardDocument_Page(....):
e.Graphics.DrawString("String1", cardFont, Brushes.Black, 400, 300);
e.Graphics.DrawString("String2", cardFont, Brushes.Black, 500, 300);



Code that send commande directely to the printer:
DOCINFO di = new DOCINFO();
int pcWritten = 0;  
PrintDirect.OpenPrinter("\\\\10.1.0.40\\HPLaserJ", ref lhPrinter, 0);
PrintDirect.StartDocPrinter(lhPrinter, 1, ref di);
PrintDirect.StartPagePrinter(lhPrinter);  

string st1;
st1 = "\x1b**1M\x1b(14Y\x1b(s0p8.00h12.0v0s0b105T" + Strin+ "\x1b**0M";

 PrintDirect.WritePrinter(lhPrinter, st1, st1.Length, ref pcWritten);  
PrintDirect.EndPagePrinter(lhPrinter);
PrintDirect.EndDocPrinter(lhPrinter);
PrintDirect.ClosePrinter(lhPrinter);

classes used by  PrintDirect:
public class PrintDirect { [DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
public static extern long OpenPrinter(string pPrinterName, ref IntPtr phPrinter, int pDefault);   
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
 public static extern long StartDocPrinter(IntPtr hPrinter, int Level, ref DOCINFO pDocInfo);   
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern long StartPagePrinter(IntPtr hPrinter);   
[DllImport("winspool.drv", CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern long WritePrinter(IntPtr hPrinter, string data, int buf, ref int pcWritten);   
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern long EndPagePrinter(IntPtr hPrinter);   
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
 public static extern long EndDocPrinter(IntPtr hPrinter);   
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern long ClosePrinter(IntPtr hPrinter);



I want to print informations (PCL and other) in the same page, but not in 2 pages.

Thank you for your Help.
QuestionARCGIS, Please help!! It's urgent Pin
Andisheh_K18-Jun-09 4:11
Andisheh_K18-Jun-09 4:11 
AnswerRe: ARCGIS, Please help!! It's urgent Pin
DaveyM6918-Jun-09 4:17
professionalDaveyM6918-Jun-09 4:17 
GeneralRe: ARCGIS, Please help!! It's urgent Pin
Andisheh_K18-Jun-09 4:40
Andisheh_K18-Jun-09 4:40 
QuestionHow to develop sliding/moving icons/images using key in windows mobile Pin
shanky118-Jun-09 4:10
shanky118-Jun-09 4:10 
AnswerRe: How to develop sliding/moving icons/images using key in windows mobile Pin
Henry Minute18-Jun-09 8:33
Henry Minute18-Jun-09 8:33 
Questionobject instance shared across entire application Pin
jackgeek18-Jun-09 3:54
jackgeek18-Jun-09 3:54 
AnswerRe: object instance shared across entire application Pin
dan!sh 18-Jun-09 3:58
professional dan!sh 18-Jun-09 3:58 
GeneralRe: object instance shared across entire application Pin
jackgeek18-Jun-09 4:48
jackgeek18-Jun-09 4:48 
GeneralRe: object instance shared across entire application Pin
dan!sh 18-Jun-09 5:10
professional dan!sh 18-Jun-09 5:10 
GeneralRe: object instance shared across entire application Pin
OriginalGriff18-Jun-09 5:15
mveOriginalGriff18-Jun-09 5:15 
AnswerRe: object instance shared across entire application Pin
Rob Philpott18-Jun-09 6:20
Rob Philpott18-Jun-09 6:20 
QuestionIgnore attributes of a class which is defined in other assembly with xml serialization [modified] Pin
rranjan32518-Jun-09 3:44
rranjan32518-Jun-09 3:44 
QuestionC# Pin
Piyush1265418-Jun-09 3:31
Piyush1265418-Jun-09 3:31 
AnswerRe: C# Pin
Nagy Vilmos18-Jun-09 3:38
professionalNagy Vilmos18-Jun-09 3:38 
QuestionCreate DLL out of a C# Project Pin
Haris18-Jun-09 1:39
Haris18-Jun-09 1:39 
AnswerRe: Create DLL out of a C# Project Pin
Not Active18-Jun-09 2:17
mentorNot Active18-Jun-09 2:17 
GeneralRe: Create DLL out of a C# Project Pin
Haris18-Jun-09 2:31
Haris18-Jun-09 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.