Pixels, cm, Header, Footer

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Pixels, cm, Header, Footer

Postby NuclearPing » Fri Jun 22, 2007 1:05 pm

I'm just evaluating "VPE 3.60 Standard" with "Delphi 6 Professional" to check if and how we can implement it in our project to replace an old printing engine.

I've got some questions:

- How can I place a picture right bound?

Like I want the picture to be placed at PageWidth - PictureWidth. I tried following:
Code: Select all
  HsReport.Picture (HsReport.nRightMargin - tmpBmp.Width, 150,
                    VFREE, VFREE,
                    FClientImageFile, PIC_KEEPIMAGE or PIC_IN_FILE);

But the picture is not where I want it to be. Its over the border of the paper. I can understand that this is because the measurements of the paper are in cm / inches and the picture width is in pixels. How can I fix this? Just use any "Pixels to Cm"-conversion routine I can find?

- How can I create Header / Footer text?

We want to have some client informations and company logo in the header and some text and page numbers (x of y) in the footer. How can I realize this?
NuclearPing
 
Posts: 4
Joined: Fri Jun 22, 2007 10:54 am

Postby IDEAL Software Support » Fri Jun 22, 2007 2:36 pm

You can use the method VPE.RenderPicture() to compute the width and height of an image (without inserting it into a document) in metric units.

Code: Select all
HsReport.RenderPicture (VFREE, VFREE,
                    FClientImageFile, PIC_KEEPIMAGE or PIC_IN_FILE);


Afterwards you can retrieve the width of the image with the property nRenderWidth and insert the image with:

Code: Select all
HsReport.Picture (HsReport.nRightMargin - HsReport.nRenderWidth, 150,
                    VFREE, VFREE,
                    FClientImageFile, PIC_KEEPIMAGE or PIC_IN_FILE);


For Headers and footers, please see the help file titled "Programmer's Manual", in the chapter "Programming Techniques", subchapter "Multipage Documents", section "Headers and Footers".

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm

Postby NuclearPing » Fri Jun 22, 2007 2:43 pm

Works perfectly, thanks! :)
NuclearPing
 
Posts: 4
Joined: Fri Jun 22, 2007 10:54 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 96 guests