PDF Converter and Images

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: 2
Joined: Thu Nov 03 2005

PDF Converter and Images

Post by OECBruce »

I am using the Pegasus Imag'N control to display (and print) images. I am trying to use PDF Converter to dump these images into (obviously) a PDF file, but have hit some kind of wall.

The code in question is:

imeImage.PaintDCA Printer.hDC imeImage.ViewBufferID, 0,0,Printer,ScaleWidth, Printer.ScaleHeight,"","",VIEW_SMOOTHING+SCALE_DEST

Obviously, much of the code above is related purely to the Imag'N control - but the main point is that it is printing to the Printers hDC. This works fine to a printer, but not to the PDF Converter. I have tested just plain text in place of the images, and that works fine, so I am quite sure I am initializing the PDF Converter and sending to it using the Printer.Print method correctly.

Any ideas anyone?
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002

Post by Joan »


At the time you are calling the Print function to print your image to the PDF Printer, did you check that 'Printer.hdc' is effectively the hdc of the PDF Pinter?

Are you calling EnablePrinter() right before printing?

I would suggest that you try something similar to the following instead of using Printer.hdc:

Code: Select all

cdi = cdintfEx.cdintfEx
cdi = DriverInit (Amyuni PDF Printer Name)
imeImage.PaintDCA cdi imeImage.ViewBufferID, 0,0,Printer,ScaleWidth, Printer.ScaleHeight,"","",VIEW_SMOOTHING+SCALE_DEST 
The above is definitely not the appropriate code, it is just an illustartion to show you that you need to initialize the printer first and then use it. I am using the ActiveX interface here.

When printing a text did ou use this same code I guess not, I guess you printed the text from another application than Image'N.

If you are still facing problems please tell us what exactly happen when printing the image using Image'N control to the PDF Printer.

Hope this helps.
Post Reply