Thanks for replying.
When I first saw that post from Bruno I assumed the
following would work:
> > document.newPage();
> > document.setMargins(172, 172, 172, 172);
But it did NOT, as I explained earlier (see test code
below). Am I doing something wrong??
Francois.
== MY TEST CODE ==
Document document = new Document(PageSize.LETTER);
writer = PdfWriter.getInstance(document, new
FileOutputStream("c:\\pdf\\margins2.pdf"));
document.setMargins(72, 72, 72, 72);
document.open();
for (int i = 0; i < 10; ++i) {
Paragraph par = new Paragraph();
for (int j = 0; j < 50; ++j)
par.add(new Chunk("Hello World "));
document.add(par);
}
document.newPage();
// change margins here
document.setMargins(172, 172, 172, 172);
for (int i = 0; i < 10; ++i) {
Paragraph par = new Paragraph();
for (int j = 0; j < 50; ++j)
par.add(new Chunk("Bonjour le Monde "));
document.add(par);
}
document.close();
--- Paulo Soares <[EMAIL PROTECTED]> wrote:
> In my opinion margins should behave like the page
> size but there are other
> issues. See
>
http://sourceforge.net/mailarchive/message.php?msg_id=1106857.
>
> Best Regards,
> Paulo Soares
>
> > -----Original Message-----
> > From: Francois Gravel [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 09, 2002 15:09
> > To: [EMAIL PROTECTED]
> > Subject: [iText-questions] Changing margins in
> middle of document
> >
> > Hi All,
> >
> > I'm trying to change margins in the middle of a
> > document, but I just can't get it to work right.
> I
> > tried:
> >
> > document.setMargins(172, 172, 172, 172);
> > document.newPage();
> > (The new page is OK but the current page's left
> and
> > right margins get messed up)
> >
> > document.newPage();
> > document.setMargins(172, 172, 172, 172);
> > (The first page where setMargins is called is
> messed
> > up, the following ones are ok)
> >
> > It also tried onStartPage and onEndPage in
> > EventHandlers. Again the transition is just not
> > right.
> >
> > It looks like the safest place to change margins
> is at
> > the start of PdfDocument.initPage() (I tried and
> it
> > worked fine). Why isn't onStartPage called from
> > there?
> >
> > I'd like to avoid bastardizing my iText library,
> so
> > any suggestion would be greatly apreciated.
> >
> > Thanks
> >
> > Francois.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Sign up for SBC Yahoo! Dial - First Month Free
> > http://sbc.yahoo.com
> >
> >
> >
>
-------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Stuff, things, and much much more.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> >
>
https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>
-------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Stuff, things, and much much more.
> http://thinkgeek.com/sf
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/itext-questions
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions