You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Janne Jokitalo <ja...@gmail.com> on 2024/02/26 10:24:26 UTC
Inserting HWPFDocument into XWPFDocument
Hi,
I tried to search on the archives for this, but couldn't find it. Is there
a way to insert HWPFDocument data into an existing XWPFDocument? I have
multiple Word documents that need to be combined, and some of them are of
the "application/msword" format, while a template and some others are of
the XML-based format.
I thought of extracting a range of the HWPFDocument, but couldn't come up
with a way to insert that into the combined one.
Thanks for any possible help in advance!
Best regards,
Jaska
Re: Inserting HWPFDocument into XWPFDocument
Posted by Janne Jokitalo <ja...@gmail.com>.
Hi Dominik, and thanks for your reply!
I ended up using the JodConverter for this job, so hopefully that problem
is solved now.
Best wishes,
Jaska
On Thu, Feb 29, 2024 at 2:57 PM Dominik Stadler
<do...@gmx.at.invalid> wrote:
> Hi,
>
> as both formats are fundamentally different, you likely will need to
> manually convert the contents between the two file-types to transparently
> include content from HWPF into XWPF.
>
> The OOXML formats sometimes have ways to "embed" other content, so there
> maybe is some way, but it likely is fairly complicated and maybe not
> supported well by some tools. So not sure if this would be feasible here as
> likely not many people have used such features of the format.
>
> Dominik.
>
>
> On Mon, Feb 26, 2024 at 11:24 AM Janne Jokitalo <ja...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I tried to search on the archives for this, but couldn't find it. Is
> there
> > a way to insert HWPFDocument data into an existing XWPFDocument? I have
> > multiple Word documents that need to be combined, and some of them are of
> > the "application/msword" format, while a template and some others are of
> > the XML-based format.
> >
> > I thought of extracting a range of the HWPFDocument, but couldn't come up
> > with a way to insert that into the combined one.
> >
> > Thanks for any possible help in advance!
> >
> > Best regards,
> >
> > Jaska
> >
>
Re: Inserting HWPFDocument into XWPFDocument
Posted by Dominik Stadler <do...@gmx.at.INVALID>.
Hi,
as both formats are fundamentally different, you likely will need to
manually convert the contents between the two file-types to transparently
include content from HWPF into XWPF.
The OOXML formats sometimes have ways to "embed" other content, so there
maybe is some way, but it likely is fairly complicated and maybe not
supported well by some tools. So not sure if this would be feasible here as
likely not many people have used such features of the format.
Dominik.
On Mon, Feb 26, 2024 at 11:24 AM Janne Jokitalo <ja...@gmail.com>
wrote:
> Hi,
>
> I tried to search on the archives for this, but couldn't find it. Is there
> a way to insert HWPFDocument data into an existing XWPFDocument? I have
> multiple Word documents that need to be combined, and some of them are of
> the "application/msword" format, while a template and some others are of
> the XML-based format.
>
> I thought of extracting a range of the HWPFDocument, but couldn't come up
> with a way to insert that into the combined one.
>
> Thanks for any possible help in advance!
>
> Best regards,
>
> Jaska
>