And yes, I'm using PDFBox 1.7.1. -----Original Message----- From: McManus, Mike Sent: 16 August 2012 09:03 To: '[email protected]' Subject: RE: PDFBox and MS Word PDFs
Hi Mehdi I've attached the PDF. It is as simple a document as I could create via MS Word. I attempted to replace "x" with "i" and got "?". Thanks in advance for your help. Mike -----Original Message----- From: mehdi houshmand [mailto:[email protected]] Sent: 16 August 2012 08:36 To: [email protected] Subject: Re: PDFBox and MS Word PDFs Hi Mike, Could you provide the PDF that you ran ReplaceString on? Obviously make sure you anonymise any sensitive information, but there could be several things at play here and it isn't obvious which one could be the cause without seeing the actual PDF. Also, which version of PDFBox are you using? Have you tried using the latest 1.7.1 release? Thanks Mehdi On 16 August 2012 08:27, McManus, Mike <[email protected]> wrote: > Hi > > I have been looking at PDFBox and ran the HelloWorld example to create > a pdf containing a single character then ran the ReplaceString example > to replace that character with another. That worked fine, the new > document contained the replacement character. > > I then replaced my single character pdf with one generated from MS > Word > 2007 > save-as-pdf and ran the ReplaceString example again. This time, > instead of the updated character, there was a question mark in the new > document. > > Is there something that I need to do to get PDFBox working with MS > Word PDFs, or is this not a supported flavour of PDF? > > I have ran the example through the debugger and the tokens seem to be > updated correctly but they are not being rendered correctly. The main > difference was the original pdf contained the data as a plain > COSString whereas the MS Word PDF contained the data in a COSString > within a COSArray. > > Thanks for your help. > > Mike > > > > > Information in this e-mail and any attachments is confidential, and > may not be copied or used by anyone other than the addressee, nor > disclosed to any third party without our permission. There is no > intention to create any legally binding contract or other binding > commitment through the use of this electronic communication unless it > is issued in accordance with the Experian Limited standard terms and > conditions of purchase or other express written agreement between > Experian Limited and the recipient. Although Experian has taken > reasonable steps to ensure that this communication and any attachments > are free from computer virus, you are advised to take your own steps to > ensure that they are actually virus free. > > Companies Act information: Registered name: Experian Limited. > Registered > office: Landmark House, Experian Way, NG2 Business Park, Nottingham, > NG80 1ZZ, United Kingdom. Place of registration: England and Wales. > Registered > number: 653331 > >

