I am using Divils plugin example and was playing with trying to print something from a plugin. I cant figure out how to get passed the fact that I dont have a parent form that this is all being created from. So the problem is that the ev.graphics is not created in the plugin. When the code is executed I get a object reference not set to an instance of an object for the line that is trying to Calculate the linesPerPage.
When I wrote this in a standalone it works though... I assume that is because the ev.graphics is coming from the form that I called my printpage sub in. Dont really understand the graphics stuff... among other things
Is there a way to do this. Can I create my own page on the fly that I can then access with the ev.graphics call?
Thanks
When I wrote this in a standalone it works though... I assume that is because the ev.graphics is coming from the form that I called my printpage sub in. Dont really understand the graphics stuff... among other things
Is there a way to do this. Can I create my own page on the fly that I can then access with the ev.graphics call?
Thanks
Code:
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Calculate the number of lines per page.
linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)
.
.
.
End Sub