xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: Position texts based on x-y
Date Thu, 02 Jul 2009 10:32:24 GMT
On 02 Jul 2009, at 08:05, bright wrote:

Hi

> basically what i have is a set of texts and an image of a form.
> I know the x-y position of each field to be filled in for this form,  
> and and
> i have values for each of these fields.
>
> What i want to do is, I want to set this image as the background, and
> position text values for each field according to their x-y position.
> <snip />
> My question is, how do I define xsl file and so that I can create my  
> xml
> file with x-y position as attributes and field values so that I can  
> use it
> to generate a pdf file?

You will most definitely need to look into using fo:block-containers  
that are absolute-positioned on the page[*]. One FOP limitation to  
keep in mind, is the lack of support for the z-index property. IIRC,  
FOP behaves such that block-containers that appear earlier in the  
input document are rendered below the later ones.

You could define one block-container containing the basic image (as an  
fo:external-graphic), and then add block-containers for the text that  
is to be rendered on top further on. The advantage of using  
fo:external-graphic, as opposed to background-image, is that you could  
even scale the image to fit the page if it is not the intended size.

If you're going to use widths in pixels, do remember that the default  
target-resolution for PDF is 72dpi, which may or may not match the  
resolution of your image. Recalculating the px-widths into something  
more absolute is recommended for predictable results.

[*] http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/fo/basic/blockcontainer.fo?revision=333038


HTH!

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message