0

I'm trying to print my windows form using VB.NET PowerPacks PrintForm. Below is the code I'm using to print the form. When I print the form it is not filling the full page no matter how long I make the Form's height, it leaves the space at the bottom. Is it possible to make it print a full A4 sheet instead of just 3/4 of the page?

Private Sub printButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.DoubleClick
    PrintForm1.Form = Me
    'PrintForm1.PrinterSettings.Copies = 1
    PrintForm1.PrinterSettings.DefaultPageSettings.Margins = New Printing.Margins(3, 3, 3, 3)
    PrintForm1.PrinterSettings.DefaultPageSettings.PaperSize.RawKind = Printing.PaperKind.A4
    PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = False
    PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
    PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
End Sub

Print Output

  • Can you make the form half as tall again while leaving the width the same and show us a screenshot of that? – jmcilhinney May 22 '20 at 06:36
  • Read [PowerPacks in VB: PrintForm Scaling and full page printing](https://social.msdn.microsoft.com/Forums/vstudio/en-US/b9d1eec1-a752-442f-a9c3-e3de69d642ff/powerpacks-in-vb-printform-scaling-and-full-page-printing?forum=vbgeneral) and [How to: Print a Scrollable Form](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/bb690944(v=vs.100)) –  May 22 '20 at 12:22
  • @jmcilhinney When I make the form height in to half the result is no different. When I print I get exactly the same result as before. – Saravanakumar May 22 '20 at 12:28
  • 1
    Try this method: [How to print hidden and visible content of a Container with ScrollBars](https://stackoverflow.com/a/57309095/7444103), see how it goes. Also, if your app is not DpiAware, apply this: [How to configure an app to run correctly on a machine with a high DPI setting](https://stackoverflow.com/a/13228495/7444103) – Jimi May 22 '20 at 12:51

0 Answers0