Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-alpha-9
-
Component/s: None
-
Labels:None
-
Number of attachments :5
Description
Propose a Pdf/Rtf support with the iText framework for Doxia.
Here is the architecture:
- added an itext module in doxia-modules
- created a doxia-doc-renderer (similar to doxia-site-renderer)
- created an iText plugin for maven
The iText module generates iText XML files. So, documents should be generated in Pdf or Rtf format (supported by iText).
You could see the howto in the plugin for more information or try the project tests.
According MPIR-17, we could be more generic by defining a new generated XML Doxia (I mean another DoxiaSink) and apply XSLT to generate other formats (like javahelp)
Known limitations:
- known limitations from the iText framework like roman list
- i18n for the "table of contents" title
- reports are not supported
- Renderer for Fml and Xdoc format should be improved. Parsers suppose that the renderer is HTML.
Attachments are:
- doxia zip with diff (containing doxia-doc-renderer and doxia-module-itext) and resources
- itext plugin zip with diff and resources
- a zip containing generated documents for the site project (real examples)
-
- maven-doxia-itext2.patch
- 28/Aug/09 1:18 PM
- 3 kB
- Andrew Overholt
-
- itext-xmloutput2.patch
- 28/Aug/09 1:18 PM
- 1.11 MB
- Andrew Overholt
-
Hide
- itext_plugin.zip
- 24/Feb/06 6:33 PM
- 804 kB
- Vincent Siveton
-
- itext_plugin.diff 2.05 MB
- maven-itext-plugin_resources.zip 415 kB
-
Hide
- generated-doc.zip
- 24/Feb/06 6:33 PM
- 1.58 MB
- Vincent Siveton
-
- generated-doc/.htaccess 0.1 kB
- generated-doc/about.pdf 7 kB
- generated-doc/about.rtf 8 kB
- generated-doc/about.xml 14 kB
- generated-doc/ant/build-a1.xml 0.4 kB
- generated-doc/ant/build-a2.xml 0.8 kB
- generated-doc/ant/build-a3.xml 0.9 kB
- generated-doc/ant/build-a4.xml 2 kB
- generated-doc/ant-tasks.pdf 22 kB
- generated-doc/ant-tasks.rtf 59 kB
- generated-doc/ant-tasks.xml 93 kB
- generated-doc/articles.pdf 10 kB
- generated-doc/articles.rtf 7 kB
- generated-doc/articles.xml 29 kB
- generated-doc/.../history-of-maven.pdf 7 kB
- generated-doc/.../history-of-maven.rtf 9 kB
- generated-doc/.../history-of-maven.xml 13 kB
- generated-doc/.../philosophy-of-maven.pdf 3 kB
- generated-doc/.../philosophy-of-maven.rtf 3 kB
- generated-doc/.../philosophy-of-maven.xml 4 kB
- generated-doc/benefits-of-using-maven.pdf 6 kB
- generated-doc/benefits-of-using-maven.rtf 11 kB
- generated-doc/benefits-of-using-maven.xml 17 kB
- generated-doc/css/site.css 0.8 kB
- generated-doc/.../maven-eclipse-codestyle.xml 25 kB
- generated-doc/.../maven-idea-codestyle.xml 3 kB
- generated-doc/.../mojo-api-specification.pdf 27 kB
- generated-doc/.../mojo-api-specification.rtf 60 kB
- generated-doc/.../mojo-api-specification.xml 115 kB
- generated-doc/.../svn-eol-style.txt 5 kB
-
Hide
- doxia_itext.zip
- 24/Feb/06 6:33 PM
- 352 kB
- Vincent Siveton
-
- doxia_itext_support.diff 1.58 MB
- doxia-module-itext_resources.zip 201 kB
Activity
Vincent, since iText XML generation has been discontinued (I see the XmlToPdf class doesn't exist anymore in iText's SVN trunk) do you have any plan to rewrite the ITex Doxia module? For example by writing a PDFSink that directly generate PDF elements?
I'm asking since at XWiki we're using Doxia (and WikiModel) and I'd like to find a good solution for PDF generation (also need RTF).
Thanks
-Vincent
This is a very old thread.
In march 2006, I was overloaded with work, writing the book on iText.
I remember studying an APT to PDF convertor, but I never found the time to write one.
If you want to use iText to convert a wiki to PDF, I see different alternatives:
We have a developer who is currently working on better HTML to PDF and RTF
conversion in iText (his name is Howard Shank).
Another possibility would be to 'resurrect' the old XmlToPdf stuff in a separate jar
(the code is still out there in the SVN repository).
If you need any further input from me, please send a mail to the iText mailing-list:
itext-questions@lists.sourceforge.net
We already developped a fo module and a Maven plugin:
https://svn.apache.org/repos/asf/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo
https://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-pdf-plugin
First thanks a lot Bruno and Vincent for your answers. Some additional questions.
We have a developer who is currently working on better HTML to PDF and RTF
conversion in iText (his name is Howard Shank).
Since we have events for each syntax element (paragraph, bold, list, etc) wouldn't it be easier to just directly generate PDF elements using iText rather than going through HTML generation followed by a conversion to PDF? Also this would be much faster I guess since it removed the need for parsing the HTML.
That said I see some advantage of generating first in HTML, at least for XWiki: in our events we have one for XML elements since we allow users to enter HTML. Thus for those we would need to go through a HTML to PDF transformations but maybe it can be done only for those and not for the whole document.
Another possibility would be to 'resurrect' the old XmlToPdf stuff in a separate jar
(the code is still out there in the SVN repository).
This is why I was asking Vincent what his plans were since there are now 2 ways in Doxia to generate PDF: using the iText doxia module (which uses XmlToPdf) or using the FO module which then requires FOP to transform to PDF.
So from Vincent's answer I think he's going the FO route...
That's the one we currently have in XWiki and which has some quirks. I was hoping to find a better way, for example by using iText through the Doxia iText module but what I really want is minimize the amount of work on my side and thus go with the supported Doxia solution.
So Vincent can you confirm the iText Doxia module is currently "obsoleted" by the FO module and not maintained anymore?
Vincent have you though about writing directly PDF elements using iText as I suggest above?
Thanks
-Vincent
So Vincent can you confirm the iText Doxia module is currently "obsoleted" by the FO module and not maintained anymore?
The fo approach sounds better today so I could considered the iText module more as a deprecated module...
Vincent have you though about writing directly PDF elements using iText as I suggest above?
Go back to the past... IIRC, when I tried to integrate iText to Doxia, it was not possible to do that.
Since the Doxia API is now more stable, I guess we could retry this way. Do you want to make a proof of concept?
Hi,
I am attempting to update the package of Doxia in Fedora. We have iText 2.1.7 and no earlier versions. Due to licensing concerns with previous versions [1], I decided it may be easier to forward-port the old XML interfaces for use by Doxia. I have attached 2 files, one of which is my forward-port patch of the XML bits from iText 1.4.4 to 2.1.7 and the other is a patch to Doxia to use iText 2.1.7 with this patch.
Everything builds successfully but I end up with test failures in ITextSinkTestCase. Bruno, if you're listening, could you give a hint?
Thanks,
Andrew
I'm writing my second book about iText, and I still have my dayjob (to pay the bills), so currently I don't have much time.
I guess that your question is about the XmlWriter and different Xml2Pdf classes. They used to work in the past, but as described in my first book: there are better ways to do it. As I suggested a year ago (I'm surprised I had the time to answer back then, because that was when my son had Cancer and a week before I got ill myself), you could 'resurrect' the XML package, but when I look at your patch, it contains several RTF files that seem irrelevant. That confuses me. The RTF package is still present in iText, why the need for those files in your patch?
Also I have never heard of the ITextSinkTestCase. Please prepare a small jar with ONLY the XML package and a small standalone example that reproduces the problem. Then send a mail to the iText mailing list itext-questions@lists.sourceforge.net and explain the problem there.
I'll take a look at the files you have attached to this post.
Note that support for iText XML generation has been discontinued.
I do have plans to study the Wiki2PDF functionality that is inside the Eclipse plug-in plog4u.
Maybe I'll adapt it into an APT2PDF package.