Hello Daniel,

On Apr 28, 2010, at 1:32 AM, Daniel Cane wrote:
> Interesting - could you show me how you define your spot function? The idea of
> simply assembling a 'top' spot, 'left' spot and 'right' spot is appealing, but
> I'm a little lost on how to implement it. Are spots = paragraphs or templates 
> or
> what?
> 
> Also, how would this work with a different header / footer on all pages after
> the first page? 
> 
> I very much appreciate your suggestion!
> 
The Spot is a class or better yet an enum type which has a corresponding stored 
configuration in your preferred configuration format e.g. xml, properties, txt 
etc. The client code can refer to Spots by the appropriate enum instance e.g. 

spot.properties:

TOP_LEFT=23,0,repeat
TOP_RIGHT=250,0,repeat
etc

the client code would look like this:

IBuilder builder = ...
builder.addPdfTemplate(Spot.TOP_LEFT,load(Parts.HEADER));

note that client code does not exactly know what TOP_LEFT details are ...
 
The Spot type could also have some sort of small gap constant value maybe also 
externalized in configuration which would support functions like this:
Spot.TOP_LEFT.right().right() so you would have finer control on the coordinate 
positions but again I would avoid any algorithm that moves things around 
because:
- complexity
- possible lose of predictability of the visual output

From all the ideas I thought of for implementing the layout, this was the 
simplest one ...

HTH,
Best regards,
Giovanni  

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to