I had the same problem as Sandy and Bruno.
Technically, the protected os reference is defined in
com.lowagie.text. This should be visible within the
package and to subclasses. Therefore it should not be
visible to PdfBody, and this is consistent with the
error we receive. However when I try to illustrate
this concept with a simple example, it works as
(un)expected. I compiled with Sun javac 1.3.1 and
1.4.0 and have not been able to figure out the
difference.
Anyway, I had to patch PdfWriter to get it to work.
What I did:
1) Modify the super ctor call to wrap os in an
OutputStreamCounter.
2) Add this method to provide access to os and
conveniently cast the OutputStreamCounter:
/** for inner classes */
private OutputStreamCounter getOutputStreamCounter()
{
return (OutputStreamCounter)os;
}//end getOutputStreamCounter
3) Modify the various modified points in PdfBody.add*
methods' references from writer.os to
writer.getOutputStreamCounter().
--- Paulo Soares <[EMAIL PROTECTED]> wrote:
> That's a compiler or IDE problem on your part.
>
> The PdfWriter definition is:
>
> public class PdfWriter extends DocWriter
>
> In DocWriter:
>
> protected OutputStreamCounter os;
>
> So, os is visible.
>
> Best Regards,
> Paulo Soares
>
> > -----Original Message-----
> > From: Sandy Daum [SMTP:[EMAIL PROTECTED]
> > Sent: Tuesday, March 25, 2003 15:48
> > To: [EMAIL PROTECTED]
> > Subject: [iText-questions] write.os is not visible
> >
> >
> >
> >
> >
> > I get the following message when I import the
> source from
> > itext-paulo-113.zip .
> > the field writer.os is not visible
> >
> > Any suggestions?
> >
> >
> > PdfWriter.java
> >
> > PdfIndirectObject add(PdfObject object)
> throws IOException {
> > PdfIndirectObject indirect = new
> PdfIndirectObject(size(),
> > object, writer);
> > xrefs.add(new
> PdfCrossReference(position));
> > indirect.writeTo(writer.os);
> > position = writer.os.getCounter();
> > return indirect;
> > }
> >
> >
> >
> >
> >
>
-------------------------------------------------------
> > This SF.net email is sponsored by:
> > The Definitive IT and Networking Event. Be There!
> > NetWorld+Interop Las Vegas 2003 -- Register today!
> >
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> >
>
https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>
-------------------------------------------------------
> This SF.net email is sponsored by:
> The Definitive IT and Networking Event. Be There!
> NetWorld+Interop Las Vegas 2003 -- Register today!
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/itext-questions
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions