Sorry to punt this again, but is anyone able to see what I'm doing wrong here?

On Thu, Apr 2, 2009 at 7:41 AM, David Ethell
<david.eth...@ethellenterprises.com> wrote:
> I never saw a response so I decided to condense my problem into a
> small reproducible program. Here is a small test class and an attached
> PDF file that I am trying to overlay text on. The main portion of code
> that is having problems is this:
>
>                                over = stamp.getOverContent(i);
>                                ColumnText ct = new ColumnText(over);
>                                Phrase phrase = new Phrase("This is some text 
> that should show up
> in the ColumnText", FontFactory.getFont(FontFactory.HELVETICA, 18));
>                                float[] leftCol = {84,133,84,432};
>                                float[] rightCol = 
> {330,133,330,173,380,173,380,432};
>                                ct.setAlignment(Element.ALIGN_LEFT);
>                                ct.addText(phrase);
>                                ct.setColumns(leftCol, rightCol);
> //                              ct.setSimpleColumn(84, 133, 380, 432, 15, 
> Element.ALIGN_LEFT);
>                                ct.go();
>
> If you comment out the setColumns method and uncomment setSimpleColumn
> then it works. Can anyone explain why my use of setColumns is
> producing no output?
>
> Thanks,
> David
>
> On Sat, Mar 21, 2009 at 4:40 PM, David Ethell
> <david.eth...@ethellenterprises.com> wrote:
>> I'm trying to use an irregular column layout with ColumnText. When I
>> use setColumns I get no visible output on the page but when I use
>> setSimpleColumn the output is there. Here is the code snippet in
>> question if anyone can help:
>>
>> int pageNumber = 1;
>> PdfContentByte over = stamp.getOverContent(pageNumber);
>> ColumnText ct = new ColumnText(over);
>> Phrase phrase = new Phrase(savedObject.text,
>> FontFactory.getFont(FontFactory.HELVETICA, 18));
>> float[] leftCol = {40,93,40,420};
>> float[] rightCol = {440,93,440,420};
>> ct.setAlignment(Element.ALIGN_LEFT);
>> ct.addText(phrase);
>> ct.setColumns(leftCol, rightCol);
>> //ct.setSimpleColumn(34, 93, 330, 422, 15, Element.ALIGN_LEFT);
>> ct.go();
>>
>> As you can see that column arrangement is just a box. My real right
>> wall is a different shape, but in trying to test this I went with a
>> simple shape until I can figure out what I'm doing wrong. The stamp
>> variable is an instance of PdfStamper to put the text on top of an
>> existing PDF file.
>>
>> Thanks for the help,
>>
>> David
>>
>

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

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to