Use InventorViewControl to print

by Vladimir Ananyev

Q:  Is there a way to use the Inventor View Control to print?

A:  Inventor View Control has the property ApprenticeServerDocument that gives you access to methods and properties of the ApprenticePrintManager object.  This print manager allows to adjust the printing parameters and submit the print job. 

The following button event handler prints the current document using the printer "Autodesk DWF Writer for 2D".

 

Private Sub btn_PRINT_Click(sender As Object, e As EventArgs) Handles btn_PRINT.Click

    With AxInventorViewControl1.ApprenticeServerDocument

      .PrintManager.Printer = "Autodesk DWF Writer for 2D"

      .PrintManager.SubmitPrint()

    End With

End Sub

 

The attached example prints an Inventor 2014 .ipt file from a Visual Basic 2012 project.

 

image

 

Download ViewerTest_1


Comments

One response to “Use InventorViewControl to print”

  1. Thanks for sharing. This is has answered my questions.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading