Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docCreator code samples
Example 7: Convert an URL / HTML file into PDF from Visual Basic  Print Example 


    Dim IE : Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible=true

    Dim DC : Set DC = CreateObject("Neevia.docCreator")

    IE.navigate2 "http:\\www.neevia.com"
    DC.doSleep(100)

    While (IE.ReadyState<>4) or (IE.Busy)
      DC.doSleep(100)
    Wend

    DC.setParameter "DocumentOutputFormat", "PDF"
    DC.setParameter "DocumentOutputName", "testURL_VB"
    DC.setParameter "DocumentOutputFolder", "d:\"

    Dim RVal : RVal=DC.startPrinting
    If (RVal <> 0) Then MsgBox "Error while creating the virtual printer!!!"

    Dim defPrinter : defPrinter = DC.getDefaultPrinter
    DC.setDefaultPrinter DC.newPrinterName 

    IE.ExecWB 6,2

    RVal = DC.create  
    If (RVal <> 0) Then 
      MsgBox "Error while creating document!!!"& Rval
    else
      MsgBox "Done converting !!!"
    End If

    IE.Quit

    DC.setDefaultPrinter defPrinter
    RVal=DC.stopPrinting 
    If (RVal <> 0) Then MsgBox "Error while deleting the virtual printer!!!"

    Set IE=Nothing
    Set DC=Nothing




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