Hi,

Gesendet: Do, 09. Sep 2010 Von: Timo Boehme<timo.boe...@ontochem.com>

> Hi,
> 
> while adding functionality to PDFBOX parsing I stumbled upon the 
> distinct objects COSName and COSString.
> 
> Both represents strings and both can be entries in a dictionary or 
> array. 
Hmm, that's correct, but there is a small but important difference: 
A COSName object represents a constant string value used as a name for
dictionary entries or as a constant value for dictionary entries like 
"WinAnsiEncoding".
A COSString represents any other nonconstant string. e.g. the text of
a pdf.

> Thus when reading a dictionary or array entry I have to test if 
> it may be a COSName or a COSString if I want to have the string value. 
> At least in case of COSDictionary this is done in getNameAsString 
> method. But for COSArray no such method exists.
I'm not sure if it is resonable to mix up COSNames with a special meaning and 
simple COSStrings. Can you explain what exactly your are trying to do?

BR
Andreas Lehmkühler


Reply via email to