Slow printing

G

Guest

Anyone have any tips to speed up the print process in VB .NET. I am trying
to print an accounting batch journal, which are sometimes 5+ pages long, and
they are taking between 8-10 seconds for the print sub of the print document
to complete (VB6 version took +-1 second). Inside the PrintPage event, I am
pulling items from an array, assigning to a string, and using
graphics.drawstring to format the report:
strFormat.Alignment = StringAlignment.Near
str2Prt = aryPrt(PrintLine).F1
sngCurY = intTopMargin + (intLineCount *
fntRegular.GetHeight(grPage))
sngLenTxt = grPage.MeasureString(str2Prt, fntRegular).Width
rectF = New RectangleF(sngDataCol1, sngCurY, sngLenTxt,
fntRegular.GetHeight(grPage))
grPage.DrawString(str2Prt, fntRegular, Brushes.Black, rectF,
strFormat)

Is there a better way to do this or is there a consensus that slow printing
is the norm in .NET? Any help or comments would be appreciated. Thanks.

-Chris
 
R

rowe_newsgroups

Anyone have any tips to speed up the print process in VB .NET. I am trying
to print an accounting batch journal, which are sometimes 5+ pages long, and
they are taking between 8-10 seconds for the print sub of the print document
to complete (VB6 version took +-1 second). Inside the PrintPage event, I am
pulling items from an array, assigning to a string, and using
graphics.drawstring to format the report:
strFormat.Alignment = StringAlignment.Near
str2Prt = aryPrt(PrintLine).F1
sngCurY = intTopMargin + (intLineCount *
fntRegular.GetHeight(grPage))
sngLenTxt = grPage.MeasureString(str2Prt, fntRegular).Width
rectF = New RectangleF(sngDataCol1, sngCurY, sngLenTxt,
fntRegular.GetHeight(grPage))
grPage.DrawString(str2Prt, fntRegular, Brushes.Black, rectF,
strFormat)

Is there a better way to do this or is there a consensus that slow printing
is the norm in .NET? Any help or comments would be appreciated. Thanks.

-Chris

Which lines are taking a long time to complete?

Thanks,

Seth Rowe
 
G

Guest

Seth,

In general, it appears the drawstring takes longer, but it seems as though
the whole PrintPage process that takes longer. The example code I included
is part of select case where each line is printed according to a lineID and
an array is parsed for the data to print. I guess I am operating under the
assumption that the graphics.drawstring is the standard for printing in .NET
and there really aren't any other viable printing options. Any comments
would be appreciated. Thanks.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top