incubator-odf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ikeamanual <ikeaman...@gmail.com>
Subject Re: OdfDrawImage from OdfTableCell
Date Mon, 05 Dec 2011 11:42:00 GMT
Hi Devin,


> >You need a document component navigator, isn't it?
>
Yes

>
>
> >We need "level" parameter, such as level 1 returns all of the components,
> >which are the child of document root element, while level 2 contians the
> >child of level 1...
>
Yes, that would do it, but I also like this style of searching from your
current position:

TableTableElement table = OdfElement.findNextChildNode(
TableTableElement.class, secondHeader);

If we have this on the Simple level :

thisTypeVar = myCurrentElement.findNextChildNode(ofThisType)
thisTypeVar = myCurrentElement.findPrevChildNode(ofThisType)
thisTypeVar = myCurrentElement.findNextSiblingNode(ofThisType)
thisTypeVar = myCurrentElement.findPrevSiblingNode(ofThisType)

then you can navigate and null check your expectations of the document
structure.

>
> >For your use case, I think you can use Simple API iterates over all
> Tables,
> >Paragraphs, Section, and get their OdfElements using method
> >getOdfElement(), then use ODFDOM to iterate the document and give these
> >components a right sort according to the location of their OdfElements.
>

Yes, I Simple iterated over the paragraph headers and then dropped down to
ODFDOM but this
did not add much advantage so I switched to ODFDOM for the reading.

Thanks,
Jan


>
> > thanks,
> > Jan
> >
> > On Sun, Dec 4, 2011 at 7:27 AM, Devin Han <devinhan@apache.org> wrote:
> >
> > > Hi Jan,
> > >
> > > I suppose you are using ODFDOM doc API, isn't it?
> > > OK, ODFDOM doc API is deprecated in the coming release and we will not
> > > maintain it in future.
> > >
> > > I suggest you replace it with Simple API[1], which is a new convenient
> > API
> > > for ODF Documnet and has very simliar design with ODFDOM doc API. But
> > > Simple API has more powerful features and more performance tuning. You
> > can
> > > migrate to Simple API very easy.
> > >
> > > Let's back your question. If you migrate to Simple API, you can use the
> > > following simple code:
> > >
> > > Image Cell.getImage() ;
> > > Image.getOdfEelment();
> > >
> > > More information please reference the cookbook[2].
> > >
> > > Hope my answer can help you.
> > >
> > > [1] http://incubator.apache.org/odftoolkit/simple/index.html
> > > [2]
> > >
> > >
> >
> http://incubator.apache.org/odftoolkit/simple/document/cookbook/Cell.html#Set%20image
> > >
> > >
> > > 2011/12/3 ikeamanual <ikeamanual@gmail.com>
> > >
> > > > Hi,
> > > >
> > > > I have a odf cell:
> > > >
> > > > OdfTableCell cell = table.getCellByPosition(0, 1);
> > > >
> > > > and in the document the cell only has a picture/Image inside.
> > > >
> > > > How to I get an OdfDrawImage from the cell?
> > > >
> > > > thanks,
> > > > Jan
> > > >
> > >
> > >
> > >
> > > --
> > > -Devin
> > >
> >
>
>
>
> --
> -Devin
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message