1 Reply Latest reply on Jun 19, 2017 6:46 AM by Maitere Larrañaga

    Print5 method not working with ShowDialog to FALSE (eDrawings 2016 SP5 API)

    Maitere Larrañaga

      Hi,

       

      I'm using the eModelView activeX control (eDrawings 2016 SP5 version) on a Visual Studio 2010 vb.net winforms application (64bits and target framework=.NET 4.0).

      I'm able to load any file on the control, but after that what I want to do is to export the content to a PDF file using the PDFCreator printer.

       

      I'm using the Print5 method. If I set the first parameter (ShowDialog) to TRUE, there is no problem, but if I set to FALSE it doesn´t work (it generates a bad format PDF file or just triggers the OnFailedPrintingDocument event).

       

      Does anyone know how to solve it?

       

      Thanks in advance.

        • Re: Print5 method not working with ShowDialog to FALSE (eDrawings 2016 SP5 API)
          Maitere Larrañaga

          More info...

          This is the code I'm using:

           

          If Visor_SW.SheetWidth < Visor_SW.SheetHeight Then

              Visor_SW.SetPageSetupOptions(EModelView.EMVPrintOrientation.ePortrait, Printing.PaperKind.A4, 1, 1, 1,                                                            Printing.PaperSourceKind.AutomaticFeed, "PDFCreator", 0, 0, 0, 0)

          Else

                Visor_SW.SetPageSetupOptions(EModelView.EMVPrintOrientation.eLandscape, Printing.PaperKind.A4, 1, 1, 1,                                                             Printing.PaperSourceKind.AutomaticFeed, "PDFCreator", 0, 0, 0, 0)

          End If

           

          Visor_SW.Print5(False, Visor_SW.FileName, True, True, True, EModelView.EMVPrintType.eScaleToFit, 1, 0, 0, True, 1, 1, "")

           

           

          It also fails using:

          Visor_SW.Print5(False, Visor_SW.FileName, True, True, True, EModelView.EMVPrintType.eScaleToFit, 1, 0, 0, True, 1, 1, output_file)

           

          Thanks a lot