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 Visual Basic  Print Example 

Sub WPConverter()

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

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

   Dim DPSDK : Set DPSDK = CreateObject("docuPrinter.SDK")
   DPSDK.BackupSettings

   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 : RVal = DPSDK.Create ' Create output document
   If (RVal <> 0) Then MsgBox "Error while creating document!!!"

   objWordPerfect.CloseNoSave 0
   objWordPerfect.Quit

   Set objWordPerfect=Nothing

   DPSDK.RestoreSettings
   Set DPSDK=Nothing

   MsgBox "Done converting!!!"

End Sub



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