Page 1 of 1

Internationalization problem?

PostPosted: Fri Dec 10, 2010 10:28 pm
by fkfausa
Hi Jason!

Your new OpenDoPe plugin and what it does fits our needs very nicely, thanks. When I use sdt's with repeats and conditionals and save the result to pdf I get a lot of errors like this "10.12.2010 11:39:46 *ERROR* FOUserAgent: Invalid property value encountered in border-top-width="0,18mm": org.apache.fop.fo.expr.PropertyException: No conversion defined 0,18mm; property:'border-top-width' (No context info available) (LoggingEventListener.java, line 82)".
Pay attention to "0,18mm" which is the Norwegian way of using decimals. In english this would be "0.18". My resulting pdf does not contain any margins at all, all the text starts and stops at the edge of the paper. Any suggestions on what I/we can do to rectify this?

Frode

Re: Internationalization problem?

PostPosted: Sat Dec 11, 2010 11:24 am
by jason
Hi Frode

Great to hear the OpenDoPE stuff meets your needs.

Earlier this week another docx4j user identified this issue and submitted the following fix:

In the class org.docx4j.UnitsOfMeasurement there is the definition
format2DP = new DecimalFormat("##.##");
Here in Germany we use a comma as decimal separator instead of a point and the result are lots of messages like this:

07.12.2010 09:00:01 *ERROR* FOUserAgent: Invalid property value encountered in border-bottom-width="0,18mm": org.apache.fop.fo.expr.PropertyException: null:35:356: No conversion defined 0,18mm; property:'border-bottom-width' (Siehe Position 41:532) (LoggingEventListener.java, line 82)

defining format2DP like this:
format2DP = new DecimalFormat("##.##", new DecimalFormatSymbols(Locale.ENGLISH));
solves the issue :-D )


cheers .. Jason

Re: Internationalization problem?

PostPosted: Sat Dec 11, 2010 1:30 pm
by jason

Re: Internationalization problem?

PostPosted: Sun Dec 12, 2010 4:06 am
by fkfausa
Thanks Jason!

I use maven. What is the best way to get hold of the nightly build using maven? I tried donwloading the source and do a mvn install as instructed in the getting started, but the produced jar gave me errors. Any suggestions?

Frode

Re: Internationalization problem?

PostPosted: Sun Dec 12, 2010 10:31 pm
by jason
If you could pls do an svn update and retry mvn install, since I've just applied a contribution which should solve the problem: http://dev.plutext.org/trac/docx4j/changeset/1347

If you get errors following this, pls post. thanks!

Re: Internationalization problem?

PostPosted: Mon Dec 13, 2010 7:41 pm
by fkfausa
Hi Jason!

Just tried as you suggested. The original problem is now solved, but new errors occurred:

Code: Select all
13.12.2010 09:00:15 *ERROR* XmlUtils: java.lang.NullPointerException (XmlUtils.java, line 824)
; Line#: 100; Column#: 24
javax.xml.transform.TransformerException: java.lang.NullPointerException
   at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:417)
   at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440)
   at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222)
   at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:473)
   at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
   at org.apache.xpath.XPath.execute(XPath.java:337)
   at org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:134)
   at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
   at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
   at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
   at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
   at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
   at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2270)
   at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1356)
   at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
   at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1273)
   at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251)
   at org.docx4j.XmlUtils.transform(XmlUtils.java:734)
   at org.docx4j.XmlUtils.transform(XmlUtils.java:658)
   at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:350)
   at com.infosynergi.component.common.service.impl.TemplateService_impl.produceDocument(TemplateService_impl.java:42)
   at com.infosynergi.component.common.service.impl.TemplateService_impl.main(TemplateService_impl.java:79)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: java.lang.NullPointerException
   at org.docx4j.model.structure.HeaderFooterPolicy.<init>(HeaderFooterPolicy.java:111)
   at org.docx4j.model.structure.SectionWrapper.<init>(SectionWrapper.java:33)
   at org.docx4j.model.structure.DocumentModel.<init>(DocumentModel.java:96)
   at org.docx4j.openpackaging.packages.WordprocessingMLPackage.getDocumentModel(WordprocessingMLPackage.java:121)
   at org.docx4j.convert.out.pdf.viaXSLFO.LayoutMasterSetBuilder.getFoLayoutMasterSet(LayoutMasterSetBuilder.java:50)
   at org.docx4j.convert.out.pdf.viaXSLFO.LayoutMasterSetBuilder.getLayoutMasterSetFragment(LayoutMasterSetBuilder.java:36)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:343)

Re: Internationalization problem?

PostPosted: Mon Dec 13, 2010 8:08 pm
by jason

Re: Internationalization problem?

PostPosted: Mon Dec 13, 2010 8:23 pm
by fkfausa
:D
Success!!!

Thank you very much Jason.

PS! When building with maven I get the following warning. Maybe you want to do something about.

[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ docx4j -
--
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!

Frode