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 8: Convert a WordPerfect document into PDF from VB.NET  Print Example 

Sub WPConverter()

   Dim docToConvert As String = "c:\test.wpd"

   Dim objWordPerfect As Object
   objWordPerfect = CreateObject("WordPerfect.PerfectScript")
   objWordPerfect.AppMaximize()
   objWordPerfect.Backup(0)
   objWordPerfect.BackupOriginalDoc(0)
   objWordPerfect.PerfectExpert(0)

   Dim DPSDK As Object = CreateObject("docuPrinter.SDK")

   objWordPerfect.FileOpen(docToConvert)

   DPSDK.doSleep(100)

   DPSDK.documentOutputFormat = "PDF"
   DPSDK.documentOutputFolder = "c:\"
   DPSDK.documentOutputName = "demoWP"

   DPSDK.HideSaveAsWindow = True
   DPSDK.DefaultAction = 1
   DPSDK.ApplySettings()

   objWordPerfect.PrintTo(docToConvert, "docuPrinter")

   Dim RVal As Integer = DPSDK.Create ' Create output document
   If (RVal <> 0) Then MsgBox("Error while creating document!!!")

   objWordPerfect.CloseNoSave(0)
   objWordPerfect.Quit()

   objWordPerfect = Nothing
   DPSDK = Nothing

   MsgBox("Done converting!!!")

End Sub



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