I am trying to print Form using PrintForm in VB.Net
This Form has few labels and a chart control. I have used this very simple code
Dim pf As New PrintForm
pf.Form = Me
pf.PrintAction = PrintAction.PrintToFile
pf.PrintFileName = "../../generated_pdf.pdf"
pf.Print()
It generated "generated_pdf.pdf" file. When I am trying to open this file it gives me an error
Couldn’t open PDF
Something’s keeping this PDF from opening.
Any ideas on how to resolve this error and successfully generate a working pdf that can be opened and viewed with it's right contents?
The form that should be converted to pdf looks like this