Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Thanks - that is helpful - I've been looking for a way to change character styles in the middle of a paragraph. However, I still can't make it work. When I add addStyledContent() the paragraph can't be added to the document anymore. For example, if I have a character style in my file called "Emphasis", if I call addContent("Text here") everything works as expected. But if I call paragraph.addStyledContent("Text here", "Emphasis") the whole paragraph doesn't show up. I don't get an error, it just makes it so the paragraph doesn't show up in the document. Also, I've found that Paragraph.setStyle() doesn't work in jopendocument 1.3 or higher. If I revert back to jopendocument 1.2 it works fine, but 1.3 complains that it can't find the setStyle() method. Thanks! On Wednesday, March 4, 2015 at 6:37:04 AM UTC-5, ILM wrote: > > Le 03/03/2015 22:15, theminor a écrit : > > I've gotten this to work now with add() under TextDocument - thanks! > But > > can someone point out how to use addStyledContent() instead of > addContent() > > on a Paragraph? > > > > When I use addStyledContent() it just adds content just like add(), with > > the Default style in the document. For example, if > addStyledContent("Added > > Text", "Title"), where Title is a paragraph style defined in my > styles.odt > > document... > > > > Any ideas? I can't get this to work... > > Hi, > > addStyledContent() adds content inside an existing paragraph so I > think you need to pass a text > style name, not a paragraph style. > > Cheers, > Sylvain > -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Le 03/03/2015 22:15, theminor a écrit : I've gotten this to work now with add() under TextDocument - thanks! But can someone point out how to use addStyledContent() instead of addContent() on a Paragraph? When I use addStyledContent() it just adds content just like add(), with the Default style in the document. For example, if addStyledContent("Added Text", "Title"), where Title is a paragraph style defined in my styles.odt document... Any ideas? I can't get this to work... Hi, addStyledContent() adds content inside an existing paragraph so I think you need to pass a text style name, not a paragraph style. Cheers, Sylvain -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
I've gotten this to work now with add() under TextDocument - thanks! But can someone point out how to use addStyledContent() instead of addContent() on a Paragraph? When I use addStyledContent() it just adds content just like add(), with the Default style in the document. For example, if addStyledContent("Added Text", "Title"), where Title is a paragraph style defined in my styles.odt document... Any ideas? I can't get this to work... On Thursday, August 1, 2013 at 11:10:57 AM UTC-4, ILM wrote: > > Le 24/07/2013 09:50, Gmail a �crit : > > Hi, > > > > ok fine, > > > > This code does not work anymore : > > > > ODPackage outputDocument = new ODPackage(new File("styles.odt")); > > contentDom = outputDocument.toSingle(); > > final Paragraph paragraph = new Paragraph(); > > contentDom.add(paragraph); > > > > What is the correct way to do it in version 1.3 ? > > The add() method is now in TextDocument. So your second line should be > > TextDocument contentDom = outputDocument.getTextDocument(); > > > HTH, > Sylvain > > -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Le 24/07/2013 09:50, Gmail a écrit : Hi, ok fine, This code does not work anymore : ODPackage outputDocument = new ODPackage(new File("styles.odt")); contentDom = outputDocument.toSingle(); final Paragraph paragraph = new Paragraph(); contentDom.add(paragraph); What is the correct way to do it in version 1.3 ? The add() method is now in TextDocument. So your second line should be TextDocument contentDom = outputDocument.getTextDocument(); HTH, Sylvain -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Hi, ok fine, This code does not work anymore : ODPackage outputDocument = new ODPackage(new File("styles.odt")); contentDom = outputDocument.toSingle(); final Paragraph paragraph = new Paragraph(); contentDom.add(paragraph); What is the correct way to do it in version 1.3 ? kind regards willy On 24/07/13 09:36, Sylvain Cuaz wrote: Le 23/07/2013 21:49, yambo a écrit : Hi, When I try to compile src/org/jopendocument/examples/SimpleOdt2.java with the version 1.3 this fails, compiling with 1.2 seems to work. I am using java 1.7.0.17. What am I doing wrong ? Nothing, as stated on http://www.jopendocument.org/doc_benchmark.html the code was used against 1.2 and it wasn't updated. Cheers, Sylvain -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Le 23/07/2013 21:49, yambo a écrit : Hi, When I try to compile src/org/jopendocument/examples/SimpleOdt2.java with the version 1.3 this fails, compiling with 1.2 seems to work. I am using java 1.7.0.17. What am I doing wrong ? Nothing, as stated on http://www.jopendocument.org/doc_benchmark.html the code was used against 1.2 and it wasn't updated. Cheers, Sylvain -- --- You received this message because you are subscribed to the Google Groups "jOpenDocument" group. To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[jopendocument] src/org/jopendocument/examples/SimpleOdt2.java
Hi, When I try to compile src/org/jopendocument/examples/SimpleOdt2.java with the version 1.3 this fails, compiling with 1.2 seems to work. I am using java 1.7.0.17. What am I doing wrong ? kind regards willy Errors : javac src/org/jopendocument/examples/SimpleOdt2.java src/org/jopendocument/examples/SimpleOdt2.java:72: error: cannot find symbol heading.setStyle("Movie_20_Heading"); ^ symbol: method setStyle(String) location: variable heading of type Heading src/org/jopendocument/examples/SimpleOdt2.java:76: error: no suitable method found for add(Heading) contentDom.add(heading); ^ method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable (actual argument Heading cannot be converted to ODSingleXMLDocument by method invocation conversion) method ODXMLDocument.add(IFactory,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) src/org/jopendocument/examples/SimpleOdt2.java:88: error: cannot find symbol paragraph.setStyle("Synopsis_20_Para"); ^ symbol: method setStyle(String) location: variable paragraph of type Paragraph src/org/jopendocument/examples/SimpleOdt2.java:90: error: no suitable method found for add(Paragraph) contentDom.add(paragraph); ^ method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable (actual argument Paragraph cannot be converted to ODSingleXMLDocument by method invocation conversion) method ODXMLDocument.add(IFactory,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) src/org/jopendocument/examples/SimpleOdt2.java:99: error: cannot find symbol heading.setStyle("Cast_20_Heading"); ^ symbol: method setStyle(String) location: variable heading of type Heading src/org/jopendocument/examples/SimpleOdt2.java:100: error: no suitable method found for add(Heading) contentDom.add(heading); ^ method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable (actual argument Heading cannot be converted to ODSingleXMLDocument by method invocation conversion) method ODXMLDocument.add(IFactory,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) method ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is not applicable (actual and formal argument lists differ in length) src/org/jopendocument/examples/SimpleOdt2.java:109: error: cannot find symbol actor.setStyle("Cast_20_Para"); ^ symbol: method setStyle(String) location: variable actor of type Paragraph src/org/jopendocument/examples/SimpleOdt2.java:115: error: no suitable method found for add(Paragraph) contentDom.add(actor); ^ method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not applicable (actual and formal argument lists differ in length) method ODSingleXMLDocument.add(ODSingleXMLD