At 10:51 AM +0100 5/2/02, Paulo Soares wrote: > > 1) Why the are two different types of low level PDF objects? >> PRObject vs. PDFObject, etc. >> > The original objects (PdfObject) where designed to output PDF and as >such contain additional information that cannot be extracted from the read >pdf. The case of PdfString/PRString is paradigmatic. A PdfString contains a >Unicode string and an encoding. When this object is output to the pdf the >string is converted to a byte array depending on the encoding. The PRString >contains only a byte array disguised as a string that when output to the pdf >is only converted with direct byte casting. It's impossible to know what was >the original encoding. PdfStream contains the entire stream and PRStream >contains pointers to the file to save memory space. At the time this was >what I thought was the straightforward way to do things, maybe something can >be merged and changed to have an unified approach.
And it looks like there is a simple/transparent conversion between the two using the getPdfObject method of PdfReader. As such, that's fine since as I improve/enhance the pdfReader, I'll keep working with the PR objects and just make sure to convert them to the PdfObjects on their back to the caller. > > 2) Why are both these sets of objects private to their package, >> thereby disallowing "low level" access to applications? >> > This was essentially to protect the user from doing wrong things. >The structure of iText also doesn't allow to generate an arbitrary document >like PJ so it wasn't very important to expose the classes. Right. But that's exactly what I am trying to do - give iText capabilities ala PJ. As such, I now need those PdfObjects exposed... > For me they can all be public. I'm preparing a new release with >shading patterns and I'll make those classes public. I'll also see if some >of the PRObject can be eliminated and merged with the PdfObject. > Let's leave the two sets of classes, and just publicly expose the PdfObjects. I think that's a better approach for now. Can't wait to see shading patterns! How many of the different types did you do? I found that the simple linear and radial gradients were pretty easy to implement - but the more complex ones just required too many programmatic values to be viable. Leonard -- --------------------------------------------------------------------------- Leonard Rosenthol <mailto:[EMAIL PROTECTED]> Chief Technical Officer <http://www.pdfsages.com> PDF Sages, Inc. 215-629-3700 (voice) _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions