Some basics:

- fitsPage uses setWidthPercentage and the current page size and margins. It
does NOT use setTotalWidth.

- fitsPage will never work correctly with the current structure. The
generated table height is correct but the starting point in the page may be
altered if there are accumulated lines to be written. fitsPage doesn't and
can't take into account those lines.

There's no workaround unless PdfDocument is changed so that after one or
more fitsPage an add(table) must follow. In this case fitsPage would do the
necessary newline and line flushing and the result would be correct.

Best Regards,
Paulo Soares

----- Original Message -----
From: "Marc Lustig" <[EMAIL PROTECTED]>
To: "'Anton Ermak'" <[EMAIL PROTECTED]>
Cc: "'iText-questions'" <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 17:43
Subject: AW: [iText-questions] Porblem with fitsPage / getTableBottom


Hi Anton,
I am facing the same problems.
Currently, in correspondence with fitsPage() I use only
PdfPTable.setTotalWidth() to set the width. As a result the height is
okay, but unfortunately the width is shrinked by approximately 30 %.
I will work on this tomorrow again and I will let you know when I find a
solution.

Regards
Marc

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im
> Auftrag von Anton Ermak
> Gesendet: Montag, 25. August 2003 04:20
> An: Paulo Soares
> Cc: iText-questions
> Betreff: Re: [iText-questions] Porblem with fitsPage / getTableBottom
>
>
> Hello Paulo,
> Thank you for your reply.
> I try extra margin, but without any effect. There is strange
> behavior with
> fitsPage() method: On some documents it work well, but some
> generate table with height 40%-50% of page. I've search
> mailing list and found number reports with simular problem,
> but no solution. Also, I try to set table width with
> precentage and absolute values but nothing happened. I use
> Table, not PdfPTable. Maybe I need migrate to PdfPTable?
>
> Best regards,
> Anton Ermak
>
> ----- Original Message -----
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "Anton Ermak" <[EMAIL PROTECTED]>;
> "iText-questions" <[EMAIL PROTECTED]>
> Sent: Friday, August 22, 2003 8:14 PM
> Subject: Re: [iText-questions] Porblem with fitsPage / getTableBottom
>
>
> > Call fitsPage with an extra margin, just in case. 20 is a
> good number.
> >
> > Best Regards,
> > Paulo Soares
> >
> > ----- Original Message -----
> > From: "Anton Ermak" <[EMAIL PROTECTED]>
> > To: "iText-questions" <[EMAIL PROTECTED]>
> > Sent: Friday, August 22, 2003 9:11
> > Subject: [iText-questions] Porblem with fitsPage / getTableBottom
> >
> >
> > Hello,
> > I've note that table height different before and after calling of
> > Document::add() method. This caused invalid document paging in my
> > program. Does anyone have same problem? Please point me to
> workaround
> > or fix it.
> >
> > сode i use:
> >
> > generateRow(mdl);
> > if( !writer.fitsPage( table ) )
> > {
> >     table.deleteLastRow();
> >     System.out.println("[Pdf Generator] Table Bottom Before :" +
> > writer.getTableBottom( table ) );
> >     document.add( table );
> >     System.out.println("[Pdf Generator] Table Bottom After :" +
> > writer.getTableBottom( table ) );
> >     document.newPage();
> >     makeTable( mdl );
> >     generateRow(mdl);
> > }
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: VM Ware
> > With VMware you can run multiple operating systems on a single
> > machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual
> > machines at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> > _______________________________________________
> > iText-questions mailing list [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a
> single machine. WITHOUT REBOOTING! Mix Linux / Windows /
> Novell virtual machines at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> iText-questions mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click
here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to