10 Replies - 752 Views - Last Post: 11 April 2013 - 01:37 PM Rate Topic: -----

#1 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 12:30 PM

When I print a vb.net 2008 form it is Jagged, but the font is Vb6.0 is very clear.
My form is having all lablel contorls
Can you help me what are the properties I have set in VB.Net 2008 from same as VB6.0 form printing

Thanks in advance

-Sesha Reddy
Is This A Good Question/Topic? 0
  • +

Replies To: Hi, In VB.Net 2008 when print a form it is Jagged

#2 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 01:01 PM

I wonder... are you printing the form as an image? If so, the smoothness of the printing will depend entirely on how large you are printing it, because you will not be taking advantage of vector-based fonts that are resizable.

Could you show us the code you use to print your form?
Was This Post Helpful? 0
  • +
  • -

#3 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 09:26 PM

Hi,

I am not printing any image, only plain text from label.


on the 3 label controls

Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Drawing.Text

Public Class SampleForm

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
PrintForm1.Form = Me
PrintForm1.PrintAction = PrintAction.PrintToPrinter
PrintForm1.Print()
Me.Close()
Catch ex As Exception
Throw ex
End Try
End Sub
End Class
[code]
[/code]

HI,

I Have attached print screen shot, You can view same as from here

http://www.sesharedd...Print_label.jpg

Thanks
SEsha reddy
Was This Post Helpful? 0
  • +
  • -

#4 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 10:12 PM

Quote

I am not printing any image, only plain text from label.

Actually, you are printing the entire form, so you are getting the resolution of the form as it appears on your screen. So if it's, say 800*600, and if you are printing it at 300 DPI, it will probably look pretty good, but it will be very small. But if you are printing it at 72 DPI, all the text will look ragged because it's expanded without correction. Basically, the pixels will be duplicated to make up the larger size.

It will always look good on the screen, because the rendering is done to look good at the size of the font in the labels.
Was This Post Helpful? 0
  • +
  • -

#5 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 10:42 PM

HI,

Thank you for your quick reply,

But the same text if I print using VB6.0 form it is printing very nice.

I am searching to set dpi to the control

thanks
Was This Post Helpful? 0
  • +
  • -

#6 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 10:54 PM

Hi,

Changed screen resolution 800X600 even the print is same. can you guide me how to change dpi for the labels

thanks

Hi,

This is my skype id (m.seshareddy)

If possible please add, we will talk

thanks
Seshu
Was This Post Helpful? 0
  • +
  • -

#7 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 11:28 PM

View Postmullamgi, on 10 April 2013 - 11:54 PM, said:

Changed screen resolution 800X600 even the print is same. can you guide me how to change dpi for the labels

This is my skype id (m.seshareddy)

If possible please add, we will talk

I don't think you can change DPI with the PrintForm control. You might have to change your DPI setting in the printer defaults. Again, the problem is that the rendering on the screen is done to the resolution of the screen, but it's all in pixels, and printing the form is printing from pixels, and not from fonts. I'll look into this more in the morning.
Was This Post Helpful? 0
  • +
  • -

#8 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 10 April 2013 - 11:49 PM

Thank you, Waiting for your more inputs on this.
Was This Post Helpful? 0
  • +
  • -

#9 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 11 April 2013 - 09:49 AM

Well, apparently, you can't set printer properties when using PrintForm(). That being said, my printer prints the form without jaggies, looking good.

Sorry, but I don't think I can be of any further help to you.
Was This Post Helpful? 0
  • +
  • -

#10 mullamgi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-April 13

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 11 April 2013 - 10:07 AM

HI,

what is your VS Version? is it 2008 or later version?
Was This Post Helpful? 0
  • +
  • -

#11 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Hi, In VB.Net 2008 when print a form it is Jagged

Posted 11 April 2013 - 01:37 PM

View Postmullamgi, on 11 April 2013 - 11:07 AM, said:

HI,

what is your VS Version? is it 2008 or later version?

Mine is VS2010, but the .Net Framework version is what will determine what exactly happens when you use a control. I am currently using .Net 4.0
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1