Hi,

It seems that you try to load "doc" (which is binary document) and not
"docx" (which is zipped document with several XML entries).
XWPFDocument is used to load "docx" and not "doc" (according the code I
have seen and tests I have done).

Note if you want convert doc to pdf->Apache POI provides this converter,
but if you want convert docx->pdf, we have developped those converter by
using XWPFDocument
http://code.google.com/p/xdocreport/wiki/XWPFConverter

You can try our online demo at
http://xdocreport-converter.opensagres.cloudbees.net/

Regards Angelo

2012/11/2 Nick Burch <[email protected]>

> On Fri, 2 Nov 2012, ven12344 wrote:
>
>> When I am trying to convert the word document to pdf it is giving me this
>> exception.
>>
>> org.apache.poi.**POIXMLException:
>> org.apache.poi.openxml4j.**exceptions.**InvalidFormatException: Package
>> should
>> contain a content type part [M1.13]
>>
>
> This indicates it's not a well formed file. Can Word open it without
> error? If you open it and word and save-as, does that fix it?
>
> Nick
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> [email protected].**org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to