Newbie - sample code?

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
Posts: 12
Joined: Tue Jul 19 2005

Newbie - sample code?

Post by whoit »

I'm looking for VB6 sample code - just some basic stuff to get me going.

Right now, I have a simple app where I print to the vb Printer object, and render some pictures directly to the DC of the printer.

Once I initialize the Amyuni printer, can I then start using the Printer object, i.e.
Printer.Print "hello"
Printer.PageSize= 5

When do I use the Amyuni specific properties/methods vs the Printer object properties/methods?

Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Post by Joan »


Please feel free to downlaod our Access Technical Note from:
The code is in VBA, you can easily 'translate' it to VB.

You can use the Printer object if you set it to the PDF Printer othewise you can use CDIntf to set the properties of the PDF Printer. For more information about CDintf please check the developers' manual "Common Driver Interface 250.pdf" that you got with the evaluation version.

Hope this helps.
Posts: 12
Joined: Tue Jul 19 2005

Post by whoit »


I got pieces of code from the CDI reference and that worked fine.
Posts: 5
Joined: Thu Jan 11 2007
Location: Brazil

Post by paulera »

a little example for ya:

Code: Select all

'Initialize the PDF printer
Dim pdfprinter As New CDIntf.CDIntf
pdfprinter.DriverInit("PDF Compatible Printer Driver")
'you can try  pdfprinter.DriverInit("Amyuni PDF Converter")

'Configures printer
pdfprinter.DefaultFileName = "c:\test.pdf"
pdfprinter.FileNameOptions = 1 + 2

'Prints the document, doesn't matter how
Call PrintMyDocument

'Restore default configuration
pdfprinter.DefaultFileName = ""
pdfprinter.FileNameOptions = 0

'Finish the job
This way, you will set the PDF cenverter as the default printer before print your document. When you call the DriverEnd method, the original default printer will be restored.

Maybe help.

Post Reply