Click here to Skip to main content
15,881,204 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problems with ID Automation Pin
Qendro25-Sep-09 3:04
Qendro25-Sep-09 3:04 
QuestionPrinting multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 2:37
jameschristianii25-Sep-09 2:37 
AnswerRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 2:54
musefan25-Sep-09 2:54 
GeneralRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 3:07
jameschristianii25-Sep-09 3:07 
GeneralRe: Printing multiple font sizes on the same page... Pin
musefan25-Sep-09 4:24
musefan25-Sep-09 4:24 
AnswerRe: Printing multiple font sizes on the same page... Pin
Dave Kreskowiak25-Sep-09 4:27
mveDave Kreskowiak25-Sep-09 4:27 
GeneralRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 4:32
jameschristianii25-Sep-09 4:32 
GeneralRe: Printing multiple font sizes on the same page... Pin
Dave Kreskowiak25-Sep-09 5:19
mveDave Kreskowiak25-Sep-09 5:19 
Think of each string of text as an object that needs to be drawn on the page. Each object needs to supply certain things to your drawing engine. The first, obvisouly, is the text that needs to be drawn. You also need to know where on the page the text needs to be drawn and in what font, style, and size. In your OnPrintPage event handler, the code needs to enumerate the collection of these objects and draw each string at the position where it needs to be and with the correct font.

To use something like this, you'd probably do something like:
ReceiptPrint receipt = new ReceiptPrint();
// Draw the receipt store header.
receipt.AddDrawCommand(new TextDrawCommand("Some Store Header Text", "Arial", 16, FontStyle.Bold));
receipt.AddDrawCommand(new TextDrawCommand("Some Address Text", "Courier New", 10, FontStyle.Normal));
receipt.AddDrawCommand(new TextDrawCommand("------------------------", "Courier New", 10, FontStyle.Normal));
// Draw the list of items on the receipt.
foreach(...)
    receipt.AddDrawCommand(new TextDrawCommand(ItemText, "Arial", 10, FontStyle.Normal));
// Now print the page.
receipt.Print();



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 5:51
jameschristianii25-Sep-09 5:51 
AnswerRe: Printing multiple font sizes on the same page... Pin
jameschristianii25-Sep-09 17:44
jameschristianii25-Sep-09 17:44 
AnswerRe: Printing multiple font sizes on the same page... Pin
jameschristianii26-Sep-09 5:30
jameschristianii26-Sep-09 5:30 
Questionsingle User single login Pin
Shalini_U25-Sep-09 2:37
Shalini_U25-Sep-09 2:37 
AnswerRe: single User single login Pin
musefan25-Sep-09 2:47
musefan25-Sep-09 2:47 
GeneralRe: single User single login Pin
Shalini_U25-Sep-09 3:16
Shalini_U25-Sep-09 3:16 
GeneralRe: single User single login Pin
Dave Kreskowiak25-Sep-09 4:20
mveDave Kreskowiak25-Sep-09 4:20 
GeneralRe: single User single login Pin
musefan25-Sep-09 4:28
musefan25-Sep-09 4:28 
QuestionUpload data to Amibroker? Pin
$uresh $hanmugam25-Sep-09 2:32
$uresh $hanmugam25-Sep-09 2:32 
QuestionDataTableColumn.AutoIncrementSeed value Pin
Doktor25-Sep-09 0:13
Doktor25-Sep-09 0:13 
AnswerRe: DataTableColumn.AutoIncrementSeed value Pin
S.Dhanasekaran25-Sep-09 1:04
S.Dhanasekaran25-Sep-09 1:04 
GeneralRe: DataTableColumn.AutoIncrementSeed value Pin
Doktor25-Sep-09 1:15
Doktor25-Sep-09 1:15 
AnswerRe: DataTableColumn.AutoIncrementSeed value Pin
Dave Kreskowiak25-Sep-09 3:59
mveDave Kreskowiak25-Sep-09 3:59 
GeneralRe: DataTableColumn.AutoIncrementSeed value Pin
Doktor25-Sep-09 4:20
Doktor25-Sep-09 4:20 
QuestionDifference between Button and Command button in .net Pin
r aa j24-Sep-09 23:20
r aa j24-Sep-09 23:20 
AnswerRe: Difference between Button and Command button in .net Pin
monstale24-Sep-09 23:44
monstale24-Sep-09 23:44 
Question[Message Deleted] Pin
bounik24-Sep-09 22:39
bounik24-Sep-09 22:39 

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.