Closed GoogleCodeExporter closed 8 years ago
The mechanism has changed. You can set uri resolver directly in XHMLOptions
using chaining methods - there is no need to set it via some key
This should work:
Options.getFrom(...).via(...).subOptions(XHTMLOptions.create().URIResolver(...))
Original comment by abe...@gmail.com
on 17 Feb 2012 at 7:48
@Angelo - did you try this new mechanism?
I don't consider this issue as a 'real' bug.
Original comment by abe...@gmail.com
on 20 Feb 2012 at 9:18
Hi Leszek,
Ok I understand this mechanism, but Options must support the old mecanism too
because you must create an Options without knowing XHTMLOptions class. In
webapp demo for instance, IURIResolver must be created and XHTMLOptions (from
the odt and docx converter) is not knwown because as XDocReport is modular
XHTMLOptions from the odt/docx converter could be not in the classpath.
In teh webapp demo, IURIResolver is created like this:
----------------------------------------------------------
Options options = Options.getFrom( "ODT" );
OptionsHelper.setURIResolver( options, new fr.opensagres.xdocreport.converter.IURIResolver()
{
public String resolve( String uri )
{
return null;
}
} );
----------------------------------------------------------
As you can see fr.opensagres.xdocreport.converter.IURIRseolver is generic (and
don't belong to docx or odt converter).
I have modified the code to support the two mechanism
(Options.getFrom(...).via(...).subOptions(XHTMLOptions.create().URIResolver(...)
)
and the below mechanism).
I have created JUnit for that :
* http://code.google.com/p/xdocreport/source/browse/converter/fr.opensagres.xdocreport.converter.docx.xwpf/src/test/java/fr/opensagres/xdocreport/converter/docx/poi/itext/PDFViaITextOptionsTestCase.java
* http://code.google.com/p/xdocreport/source/browse/converter/fr.opensagres.xdocreport.converter.docx.xwpf/src/test/java/fr/opensagres/xdocreport/converter/docx/poi/xhtml/XHTMLOptionsTestCase.java
* http://code.google.com/p/xdocreport/source/browse/converter/fr.opensagres.xdocreport.converter.odt.odfdom/src/test/java/fr/opensagres/xdocreport/converter/odt/odfdom/itext/PDFViaITextOptionsTestCase.java
* http://code.google.com/p/xdocreport/source/browse/converter/fr.opensagres.xdocreport.converter.odt.odfdom/src/test/java/fr/opensagres/xdocreport/converter/odt/odfdom/xhtml/XHTMLOptionsTestCase.java
So now the webapp demo is working with odt->xhtml and docx->xhtml to display
image.
I have modified too your code to retrieve the system encoding that I have moved
to
http://code.google.com/p/xdocreport/source/browse/thirdparties-extension/fr.open
sagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/e
xtension/font/AbstractFontRegistry.java to share it with docx+odt converter and
I compute it once time.
If you are with my modification, you can close the bug.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 20 Feb 2012 at 10:01
It's ok for me.
Original comment by abe...@gmail.com
on 20 Feb 2012 at 11:05
Original issue reported on code.google.com by
angelo.z...@gmail.com
on 17 Feb 2012 at 4:35