Visual Basic Development Bookmark and Share   
 Home > Visual Basic Power Packs > problem with printpreview
 

problem with printpreview

Hi, I'm trying to print address labels using a Dymo LabelWriter 400 printer. I've managed to print a lable using 'Word' and Notepad (so happy the printer is installed& working) and from VB (using PrintForm)it outputs a lable but no text on it.
So I'm trying to use 'printpreview' to check whats being printed - it seems to work ok if I havea A4 laser printer selected as the default printer but not if I have a Dymo LabelWriter 400 as the default.
Any suggestions please?
Kevin
kevinbennett126  Monday, September 14, 2009 11:27 AM
Hi Kevin,

You can set the paper size like below:

Me.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
Dim pkCustomSize1 As New PaperSize("Custom Paper Size", 1000, 2000)
Me.PrintForm1.PrinterSettings.DefaultPageSettings.PaperSize = pkCustomSize1
Me.PrintForm1.Print()

But i do not know it will be the issue as you mentioned that the label is there.

John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Wednesday, September 16, 2009 5:15 AM

Are you saying that you can't see the label in preview when using the PrintForm control with Dymo LabelWriter 400 as the default?
Can you add some more controls on the form and see if it is showing up?
I do not have the printer so not able to test it.
Can Dymo LabelWriter print any graph? E.g. add a picture in the Word and see if it can print the picture.
I wonder that the PrintForm is printing a sceenshot and the printer cannot print the picture, just a guess.

John


John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Tuesday, September 15, 2009 3:20 AM

Are you saying that you can't see the label in preview when using the PrintForm control with Dymo LabelWriter 400 as the default?
Can you add some more controls on the form and see if it is showing up?
I do not have the printer so not able to test it.
Can Dymo LabelWriter print any graph? E.g. add a picture in the Word and see if it can print the picture.
I wonder that the PrintForm is printing a sceenshot and the printer cannot print the picture, just a guess.

John


John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.

Hi John, what I see in the PrintPreview is an image of a blank label (and if I issue a print-to-printer command I get a blank label out ) where as if I default to a standard A4 laser printer I see (& get) an image of the form which simply contains some text boxes with dummy text in them.
The Dymo 400 is capable of graphics.
Since posting here I've fired up my old copy of VB3 - within 1/2 hour I had written the code and printed to the Dymo - no problem.
I now have the dilema ..... do I stick with the old (and trusty LOL) VB3 or struggle with the unknown, but better VB.net ?

Thanks for your help,
Kevin
kevinbennett126  Tuesday, September 15, 2009 8:16 AM
Hi Kavin,

So it seems to me there is a font problem here. If you add a text box or a button on the form, can you see them on the print form preview? Is there any text with the text box or button?

For your dilema, it depends on what is your goal, if you are using the printer for a simple task for yourself, use it. However, do not stop yourself moving to the .Net world because of thisissue. :-).

John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Tuesday, September 15, 2009 3:37 PM
Hi John,
Thanks for the reply,

The form contains three Textbox with dummy text in them.
I have even used the "CompatibleModeFullWindow" to show the whole form - but still only see a blank label on the print for preview :-(
The blank label (in the preview) does appear to be the correct size/aspect though (35mm x 88mm).

I'm guessing it might be a page setup problem, maybe margins/headers/footers ..... but unsure how to set them from code and not sure if changing the default values in the Windows Printer setup is adequate.
(by the way I'm running Win XP ...... but don't think that should be a problem? .....)

Kevin
kevinbennett126  Tuesday, September 15, 2009 4:49 PM
Hi Kevin,

You can set the paper size like below:

Me.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
Dim pkCustomSize1 As New PaperSize("Custom Paper Size", 1000, 2000)
Me.PrintForm1.PrinterSettings.DefaultPageSettings.PaperSize = pkCustomSize1
Me.PrintForm1.Print()

But i do not know it will be the issue as you mentioned that the label is there.

John Chen -- See my team blog: http://blogs.msdn.com/vsdata. All my posts are provided "AS IS" with no warranties, and confer no rights.
John Chen MS  Wednesday, September 16, 2009 5:15 AM

You can use google to search for other answers

Custom Search

More Threads

• can't register Microsoft.InteropFormTools.dll
• Using vml line in DHTMLEdit control for rendering lines in asp pages. BUt when page is reloaded from sql server database, some lines deflects drastically on click?
• Having problems with DataRepeater control and virtual mode
• Can't view powerpack shapes from toolbox
• Rectangle Shape delay
• Graphic line will not print
• PrintForm with Print Dialog Box
• Powerpack Additions (What Microsoft Forgot)
• creating new objects of custom textbox controls
• Can we draw a LineShape using PowerPacks at run-time?