PDF-Form Landscape
Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=404
Printed Date: 18 May 24 at 8:20PM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: PDF-Form Landscape
Posted By: hkoestner
Subject: PDF-Form Landscape
Date Posted: 28 Apr 06 at 2:29PM
I am working on a solution concerning the presentation of PDF-forms in a delphi form. The solution is based on the "FormTool" of "Chicks".
With forms in the landscape format the problem occurs that the fields are aligned vertically instead of horizontally.
The problem can also be reproduced with "FormTool".
Does anybody have a solution for this problem?
|
Replies:
Posted By: chicks
Date Posted: 28 Apr 06 at 5:15PM
Can you post an example PDF with the issue somewhere?
|
Posted By: hkoestner
Date Posted: 28 Apr 06 at 5:51PM
Hi chicks,
no problem, you can find it here:
http://www.formsoft.de/quer.pdf
best regards
|
Posted By: hkoestner
Date Posted: 03 May 06 at 4:15AM
Hi chicks,
any idea? - The example was created with Acrobat 6
best regards
|
Posted By: chicks
Date Posted: 03 May 06 at 1:35PM
Well, I haven't had time to play with this too much, but here's a start:
In the RenderPage function, check the page rotation (I'm only checking non-zero here, but would need to be more sophisticated), and set pageWidth and pageHeight accordingly:
IF iSEDPageRotation() <> 0 THEN
pageWidth = iSEDGetPageBox(2,3)
pageHeight = iSEDGetPageBox(2,2)
ELSE
pageWidth = iSEDGetPageBox(2,2)
pageHeight = iSEDGetPageBox(2,3)
END IF
Also in RenderPage, check the form fields for rotation, and position accordingly:
scale = iResolution / 72
FOR i = 1 TO fieldCount
IF Fields(i).page = iCurPage THEN
id = Fields(i).fldID
IF iSedGetFormFieldRotation(id) <> 0 THEN
Fields(i).x = (iSEDGetFormFieldBound(id, 0) - iSEDGetPageBox(2,0) ) * scale
Fields(i).y = (pageHeight - iSEDGetFormFieldBound(id, 1) + iSEDGetPageBox(2,5)) * scale
Fields(i).w = iSEDGetFormFieldBound(id, 3) * scale
Fields(i).h = iSEDGetFormFieldBound(id, 2) * scale
ELSE
Fields(i).x = (iSEDGetFormFieldBound(id, 0) - iSEDGetPageBox(2,0) ) * scale
Fields(i).y = (pageHeight - iSEDGetFormFieldBound(id, 1) + iSEDGetPageBox(2,5)) * scale
Fields(i).w = iSEDGetFormFieldBound(id, 2) * scale
Fields(i).h = iSEDGetFormFieldBound(id, 3) * scale
END IF
END IF
NEXT i
This still doesn't position the field correctly, you'll need to play with that a bit, but it does at least paint it in the correct direction.
|
Posted By: hkoestner
Date Posted: 03 May 06 at 6:24PM
Thanks Chicks
I will try it.
best regards
|
Posted By: FKirch
Date Posted: 13 May 06 at 5:04AM
Where can I find the "formtools" of chicks?
|
Posted By: chicks
Date Posted: 14 May 06 at 12:56AM
There are a few hacks here, including formtool, mostly having to do with PDF:
http://www.geocities.com/sea_sbs/files/
|
|