You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "McManus, Mike" <Mi...@uk.experian.com> on 2012/08/16 09:27:30 UTC
PDFBox and MS Word PDFs
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
RE: PDFBox and MS Word PDFs
Posted by "McManus, Mike" <Mi...@uk.experian.com>.
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:med1985@gmail.com]
Sent: 16 August 2012 08:36
To: users@pdfbox.apache.org
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 <Mi...@uk.experian.com> 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
>
>
RE: PDFBox and MS Word PDFs
Posted by "McManus, Mike" <Mi...@uk.experian.com>.
And yes, I'm using PDFBox 1.7.1.
-----Original Message-----
From: McManus, Mike
Sent: 16 August 2012 09:03
To: 'users@pdfbox.apache.org'
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:med1985@gmail.com]
Sent: 16 August 2012 08:36
To: users@pdfbox.apache.org
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 <Mi...@uk.experian.com> 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
>
>
Re: PDFBox and MS Word PDFs
Posted by mehdi houshmand <me...@gmail.com>.
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 <Mi...@uk.experian.com> 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
>
>