Re: Use pdf as background for form



"TD" <dlee@xxxxxxxxxxx> wrote in message
news:12338cab-b097-465b-953e-1ca1a2d91d35@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[...]
How do I import the Adobe Acrobat Reader activex control into Delphi?

Look through the menu. There is an option "Import ActiveX Control".


Where can I find docmentation on how to use the PaintTp procedure?

Type "PaintTp", press F1, read help.

With a slight adjustment, you can also learn about the PaintTo method.


How would I print the data so that it lines up correctly on the pdf
file when I print it?

That's actually quite hard.

The Printer unit contains things that can give you a printer canvas.
This represents the page as it will come out of the printer. TCanvas
has methods to paint onto it; again: type "TCanvas", press F1, read
help. Since the list of methods is rather long, I'll let on that you
want TextOut. But not only TextOut. Preferably, you should still read
all of it.

The hardest part about printer canvases is getting your measurements
right. The TCanvas methods work in pixels, but you shouldn't. You
should work in millimetres, or points, or thous, or whatever small
unit you are comfortable with, because unlike pixels, they will still
be the same size on a different printer. Be prepared to do lots of
conversions. Be prepared to let go of integer arithmetic and use
lots of reals.

GetDeviceCaps can tell you the numbers you need to do the conversions
and to do the adjustments - because the printer canvas starts inside
the unprintable area of the printer, which once again is different
for each printer. GetDeviceCaps is a WinAPI, not a VCL, function, so
you have to go to MSDN if you want to read up on it. And you do.

If it sounds like altogether too much trouble, you're right, it is.
Twenty years ago it was worse. *Much* worse. Today, at least you can
program against the single printer canvas. Or use a reporting library.

Or generate HTML+CSS with absolute positioning, and print that. Or a
Word document.

Groetjes,
Maarten Wiltink


.