Jump to content

Imprimir ou guardar em PDF


Recommended Posts

Boa noite,
Estou aqui com um problema.
Tenho um programa e tem a função de mandar imprimir o que está apresentado numa Form.

O que acontece é que eu quero que ele me pergunte se quero pré visualizar ou guardar em PDF ou imprimir, mas se a impressora estiver ligada ele não pergunta nada e manda simplesmente imprimir.

Deixo aqui o código para ver se alguém me consegue ajudar.

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

Dim bm As New Bitmap(Me.Panel1.Width, Me.Panel1.Height)

Panel1.DrawToBitmap(bm, New Rectangle(0, 0, Me.Panel1.Width, Me.Panel1.Height))

e.Graphics.DrawImage(bm, 0, 0)

Dim aPS As New PageSetupDialog

aPS.Document = PrintDocument1

End Sub

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.