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.

PDF Converter and Images

Postby OECBruce on Thu Nov 03 2005

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

Postby Joan on Mon Nov 07 2005

Hello,

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]cdi = cdintfEx.cdintfEx
cdi = DriverInit (Amyuni PDF Printer Name)
cdi.EnablePrinter()
imeImage.PaintDCA cdi imeImage.ViewBufferID, 0,0,Printer,ScaleWidth, Printer.ScaleHeight,"","",VIEW_SMOOTHING+SCALE_DEST [/code]

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.
Joan
Amyuni Team
 
Posts: 2799
Joined: Wed Sep 11 2002


Return to Visual Basic Community

Who is online

Users browsing this forum: No registered users and 1 guest