Thanks Thomas for the fast and very good answer. I'll try your suggestions.
I never did a patch, so it's a good opportunity to learn and contribute back . ----- original message -------- Subject: Re: Problem trying to oerwriting ID Sent: Fri, 23 Jul 2010 From: Thomas Chojecki<[email protected]> > Am 23.07.2010 20:35, schrieb Robson Bortoleto: > > I'm trying to update a database of PDF files and use a newly generated ID > to identify them (I had problems with ID duplicity caused by an older > program). The problem is that the result is wrong. The correct ID on the PDF > file should look like : > > > > /ID > [<c8039fd24c97d00fbd27edd68af8e0ef><6b63a249e40a472e9e597aff2c9d8863>] > > > > And the result of my code is : > > > > /ID[ (c8039fd24c97d00fbd27edd68af8e0ef) > (6b63a249e40a472e9e597aff2c9d8863)] > > > > I tried two different approachs and both gave the same result (see them > below) > > > > Does anyone know what I'm doing wrong ? > > There are to kinds of Strings. "Literal Strings" wrote with ( ) and > "Hexadezimal Strings" wrote with < >. > > The problem is, that pdfbox don't give you the chance to force write > hexadezimal Strings as you wish in this situation. > > Way 1: > I don't test it, but if you convert each byte-pair (2 bytes) in a char, > then convert the char[] in a String and then convert it in a new > COSString, maybe you will then get a hexadezimal String. > > Way 2: > Wait for a patch or patch it yourself. > > I append a patch to that mail, that will add a new method "public void > setForceHexForm(boolean v)" > > > > Thanks > > > > Rob > > Regards > Thomas > --- original message end ----

