You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Paul C." <wr...@yahoo.com> on 2013/03/05 16:52:00 UTC

Re: Create Header XWPF

Hi Mike,
Thanks for the post. When I was trying out your sample code, I have
difficult compiling the code. My eclipse project complaining that
STPTabRelativeTo, STHorizontalAlignment and STPTabLeader cannot be resolved.
I do have poi-ooxml-schemas-3.7-20101029.jar on my class path. Sorry I am
new to POI. Is there something that I might be missing?
Thanks,
Paul



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712242.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by Mike McCullough <mi...@gmail.com>.
You could remove all paragraphs/runs similar to how I added them in the
example code from previous emails.

On Fri, Mar 8, 2013 at 8:41 AM, Paul C. <wr...@yahoo.com> wrote:

> Guys,
> Does anyone know how to remove the footer/header from a word doc?
> I was hoping there would be something like:
> XWPFDocument document.......
> document.getHeaderFooterPolicy().removeFooter().
> However, the HeaderFooterPolicy does not seem to have any method for
> something like that.
> Anyone aware of some other way of achieving this?
> Thanks in advance.
> Paul
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712281.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Create Header XWPF

Posted by "Paul C." <wr...@yahoo.com>.
Guys,
Does anyone know how to remove the footer/header from a word doc?
I was hoping there would be something like:
XWPFDocument document.......
document.getHeaderFooterPolicy().removeFooter(). 
However, the HeaderFooterPolicy does not seem to have any method for
something like that.
Anyone aware of some other way of achieving this?
Thanks in advance.
Paul



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712281.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by "Paul C." <wr...@yahoo.com>.
According to the faq explanation, /"The full ooxml-schemas jar is distributed
with Apache POI, along with the cut-down poi-ooxml-schemas jar containing
just the common parts."/ So the problem of failed compilation was because of
me using poi-ooxml-schemas.jar instead of ooxml-schemas.jar. 
Thank you, Nick and Mike for your generous help.
Paul



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712249.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 5 Mar 2013, Mike McCullough wrote:
> I'm fairly certain the poi-ooxml-schema.jar file is auto-generated by the
> xml schemas that define the OOXML format.

Correct

> I have been unsuccessful in finding the source code.

The FAQ explains it more, and also covers how to get the sources if you 
really need them: http://poi.apache.org/faq.html#faq-N10109

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by Mike McCullough <mi...@gmail.com>.
I'm fairly certain the poi-ooxml-schema.jar file is auto-generated by the
xml schemas that define the OOXML format. I have been unsuccessful in
finding the source code. Instead, I've only relied on the ECMA
specifications (
http://www.ecma-international.org/publications/standards/Ecma-376.htm) for
the Word format and then by trial and error, determining the structure of
how the document should be formatted.

Mike

On Tue, Mar 5, 2013 at 12:27 PM, Paul C. <wr...@yahoo.com> wrote:

> Indeed, there are a lot of advantage of using Maven. However, I am not in
> the
> position of making that decision.
> I peeked into the poi-ooxml-schema.jar version 3.9 jar, I could not find
> STPTabRelativeTo.class, STPTabAlignment.class, etc. However, I see the
> inner
> classes: such as STPTabRelativeTo$Enum.class, STPTabAlignment$Enum.class,
> etc. In version 1.1, both outter class and inner classes exist. How come?
>
> Also, I don't seem to be able to find the source code for
> poi-ooxml-schema.jar. Does anyone know where to get it?
> Thanks.
> Paul
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712246.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Create Header XWPF

Posted by "Paul C." <wr...@yahoo.com>.
Indeed, there are a lot of advantage of using Maven. However, I am not in the
position of making that decision. 
I peeked into the poi-ooxml-schema.jar version 3.9 jar, I could not find
STPTabRelativeTo.class, STPTabAlignment.class, etc. However, I see the inner
classes: such as STPTabRelativeTo$Enum.class, STPTabAlignment$Enum.class,
etc. In version 1.1, both outter class and inner classes exist. How come?

Also, I don't seem to be able to find the source code for
poi-ooxml-schema.jar. Does anyone know where to get it?
Thanks.
Paul



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712246.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by Mike McCullough <mi...@gmail.com>.
Since it sounds like you're working as part of a team, I would highly
recommend that you use Maven for your project files. I cannot stress its
importance in a team environment more (or some other dependency management
tool).

Mike

On Tue, Mar 5, 2013 at 12:04 PM, Paul C. <wr...@yahoo.com> wrote:

> Thanks for the prompt reply, Mike.
> We are restricted to use Eclipse (Ganymede) as IDE. On my class path, I
> have
> the following:
> poi-3.9-20121203.jar
> poi-ooxml-3.9-20121203.jar
> poi-ooxml-schemas-3.9-20121203.jar
> xbean.jar (version 2.6)
>
> The major difference of mine setting and yours is that you are using
> poi-ooxml-schemas.jar version 1.1. So I went on line and downloaded. Sure
> enough, with the older version of schemas jar, it compiled. Isn't that
> interesting?!
>
> Paul
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712244.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Create Header XWPF

Posted by "Paul C." <wr...@yahoo.com>.
Thanks for the prompt reply, Mike.
We are restricted to use Eclipse (Ganymede) as IDE. On my class path, I have
the following:
poi-3.9-20121203.jar
poi-ooxml-3.9-20121203.jar
poi-ooxml-schemas-3.9-20121203.jar
xbean.jar (version 2.6)

The major difference of mine setting and yours is that you are using
poi-ooxml-schemas.jar version 1.1. So I went on line and downloaded. Sure
enough, with the older version of schemas jar, it compiled. Isn't that
interesting?!

Paul



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712244.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Create Header XWPF

Posted by Mike McCullough <mi...@gmail.com>.
The dependencies that I used in my maven pom.xml files include:

<dependency>
<groupId>org.apache.poi</groupId>
 <artifactId>poi-ooxml</artifactId>
<version>3.9</version>
 </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
 <artifactId>ooxml-schemas</artifactId>
<version>1.1</version>
 </dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
 <artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
 </dependency>

So you can either update your classpath to include the above jar files, or,
what I would recommend is that you use maven to handle all your dependency
management.

As a side note, if you have maven as your project file, you can easily move
towards any other java IDE that supports it as well *cough* IntelliJ IDEA
*cough*.

Mike

On Tue, Mar 5, 2013 at 10:52 AM, Paul C. <wr...@yahoo.com> wrote:

> Hi Mike,
> Thanks for the post. When I was trying out your sample code, I have
> difficult compiling the code. My eclipse project complaining that
> STPTabRelativeTo, STHorizontalAlignment and STPTabLeader cannot be
> resolved.
> I do have poi-ooxml-schemas-3.7-20101029.jar on my class path. Sorry I am
> new to POI. Is there something that I might be missing?
> Thanks,
> Paul
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Create-Header-XWPF-tp5711976p5712242.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>