Passing parms with VB

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
mattw951
Posts: 1
Joined: Fri Jan 28 2005

Passing parms with VB

Post by mattw951 »

Hello,

I am a total newbie at programming so please be forgiving if I ask elementary questisons. We are using the 2.10 convertor. I would to be able to pass the file name, location to save the pdf etc with VB can anyone please give me some sample code that could lead me in the right direction.

Secondly do I need to have the developer version to do this?

Thanks for any help!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

If you need to deliver the dll of the PDF Converter with your application to your registered customers, you need a developer license, if you need to use the PDF Converter only for an internal application (inhouse application) you may want to license a developer license or the appropriate license pack.

Please find here a VB sample that uses the ActiveX interface of CDIntf to convert a Word document to PDF.

Please note that we released version 2.50 of the PDF Converter, you can download it an use it for evaluation, also please note that with the demo version you receive a full Developer manual "Common Driver Interface 210.pdf" that you check in case you need information about any specific function:

Here is the code:

Code: Select all

Private Sub Command12_Click()

    'Create an instance of CDIntfEx
    Dim pdf As New CDIntfEx.CDIntfEx

   ' Declare the Word application and Word document
    Dim WordApp As Word.Application
    Dim WordDoc As Word.Document
          
    ' Printer initialization (the printer should be installed on the system)
    pdf.DriverInit "Amyuni PDF Converter"
             
    pdf.EnablePrinter LicenseTo, ActivationCode
        
    ' ***** Printing a Word document to PDF *****
    
    ' Set file name options
    pdf.FileNameOptionsEx = NoPrompt + UseFileName + Concatenate
    pdf.DefaultFileName = "c:\Temp\Testdoc.pdf"
    Set WordApp = New Word.Application
               
    Set WordDoc = WordApp.Documents.Open("c:\Temp\test.doc", , , , , , , , , , , True)
    
    ' Enable the printer before each printout
    pdf.EnablePrinter LicenseTo, ActivationCode
    WordDoc.Application.ActivePrinter = "Amyuni PDF Converter"
    
    ' Print the Word document (concatenated to the first pdf file)
    WordDoc.PrintOut Background:=False
   
              
    'Quit Word
    WordDoc.Close
    WordApp.Quit
    
    'Free the used objects
    Set WordDoc = Nothing
    Set WordApp = Nothing
    
    ' Reset 0ptions to zero
    pdf.FileNameOptions = 0
    
End Sub
Hope this helps, if you need more info please let us know 8)
Post Reply