B
Brad Pears
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default printer settings to print.
I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait mode). Many users have different printers as their default (plotters etc..) and I found that various users were having problems viewing the entire drawing - depending on the selected default printer.
So, to accomplish this I used the below commands to set a custom paper size and set landscape off before viewing the print preview dialog...
It works just fine for viewing but when the user clicks the printer icon, the print job appears to be displaying only a small part of the drawing as if it has zoomed way in. There is simply a soliod thick black line - which appears to possibly be a part of the drawing. After some quick testing - I determined that the line of code causing this problem is the line where I am setting the custom page size. if I comment this line out, it is fine - except I am back to the old problem of users viewing the drawing based on their currently selected printer - which may cause a screw up with the viewing...
Does anyone have any ideas on this one??
Thanks, Brad
------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Set default paper size to legal size using a custom form (length/width dimensions are in 1000's of an inch)
dlgPrintPreview.Document.DefaultPageSettings.PaperSize = New Printing.PaperSize("Custom", 8500, 14000)
' Ensure portrait printing by setting landscape as false
dlgPrintPreview.Document.DefaultPageSettings.Landscape = False
' Show it!
dlgPrintPreview.ShowDialog()
-----------------------------------------------------------------------------------------------------
I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait mode). Many users have different printers as their default (plotters etc..) and I found that various users were having problems viewing the entire drawing - depending on the selected default printer.
So, to accomplish this I used the below commands to set a custom paper size and set landscape off before viewing the print preview dialog...
It works just fine for viewing but when the user clicks the printer icon, the print job appears to be displaying only a small part of the drawing as if it has zoomed way in. There is simply a soliod thick black line - which appears to possibly be a part of the drawing. After some quick testing - I determined that the line of code causing this problem is the line where I am setting the custom page size. if I comment this line out, it is fine - except I am back to the old problem of users viewing the drawing based on their currently selected printer - which may cause a screw up with the viewing...
Does anyone have any ideas on this one??
Thanks, Brad
------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Set default paper size to legal size using a custom form (length/width dimensions are in 1000's of an inch)
dlgPrintPreview.Document.DefaultPageSettings.PaperSize = New Printing.PaperSize("Custom", 8500, 14000)
' Ensure portrait printing by setting landscape as false
dlgPrintPreview.Document.DefaultPageSettings.Landscape = False
' Show it!
dlgPrintPreview.ShowDialog()
-----------------------------------------------------------------------------------------------------