Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docuPrinter SDK code samples
Example 5: Convert a PowerPoint document into PDF from VB.NET  Print Example 

Sub PowerPointConverter()

   Dim documentToConvert As String = "c:\test.ppt"
   Dim DPSDK As Object = CreateObject("docuPrinter.SDK")

   DPSDK.DocumentOutputFormat = "PDF"
   DPSDK.DocumentOutputName = "demoPPT"
   DPSDK.DocumentOutputFolder = "c:\"

   DPSDK.PDFAutoRotatePage = "PageByPage"

   DPSDK.HideSaveAsWindow = True
   DPSDK.DefaultAction = 1

   DPSDK.ApplySettings()
   Dim MSPowerPoint As Object = CreateObject("PowerPoint.Application")

   Dim PPTDoc As Object
   PPTDoc = MSPowerPoint.Presentations.Open(documentToConvert, -1, 0, 0)
   PPTDoc.PrintOptions.PrintInBackground = 0
   PPTDoc.PrintOptions.PrintColorType = 1
   PPTDoc.PrintOptions.ActivePrinter = "docuPrinter"
   PPTDoc.PrintOut(0)
   PPTDoc.Close()
   MSPowerPoint.Quit()
   MSPowerPoint = Nothing

   Dim RVal As Integer = DPSDK.Create ' Create output document
   DPSDK = Nothing

   If (RVal <> 0) Then
     MsgBox("Error while converting the document!!!")
   Else
     MsgBox("Done converting!!!")
   End If

End Sub



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us