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.

Newbie - sample code?

Postby whoit on Tue Jul 19 2005

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
etc?

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

Thanks.
whoit
 
Posts: 12
Joined: Tue Jul 19 2005

Postby Joan on Wed Jul 20 2005

Hello,

Please feel free to downlaod our Access Technical Note from: http://www.amyuni.com/en/support/technotes.html
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.
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002

Postby whoit on Wed Jul 20 2005

Thanks.

I got pieces of code from the CDI reference and that worked fine.
whoit
 
Posts: 12
Joined: Tue Jul 19 2005

Postby paulera on Fri Jan 12 2007

a little example for ya:
[code]'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
pdfprinter.SetDefaultConfig
pdfprinter.SetDefaultPrinter

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

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

'Finish the job
pdfprinter.DriverEnd[/code]
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.

Bye
paulera
 
Posts: 5
Joined: Thu Jan 11 2007
Location: Brazil


Return to Visual Basic Community

Who is online

Users browsing this forum: No registered users and 1 guest

cron