From 2fa365b59e3e308beaed94624e6e808f964a72ab Mon Sep 17 00:00:00 2001 From: aheritier Date: Mon, 15 Aug 2005 01:08:23 +0000 Subject: [PATCH] - MPPDF-8 : Add support for external imaging libraries like jimi and jai to use PNG images in generated pdf files. - Improve some documentations git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@232683 13f79535-47bb-0310-9956-ffa450edef68 --- pdf/plugin.jelly | 3 ++ pdf/plugin.properties | 7 ++++ pdf/xdocs/changes.xml | 1 + pdf/xdocs/faq.fml | 69 +++++++++++++++++++++++++++++++++------- pdf/xdocs/index.xml | 1 + pdf/xdocs/properties.xml | 16 ++++++++++ 6 files changed, 86 insertions(+), 11 deletions(-) diff --git a/pdf/plugin.jelly b/pdf/plugin.jelly index 6da97b6b..c8f8a2c6 100644 --- a/pdf/plugin.jelly +++ b/pdf/plugin.jelly @@ -159,6 +159,9 @@ internal_pdf_workingDir = [${internal_pdf_workingDir}] + + + diff --git a/pdf/plugin.properties b/pdf/plugin.properties index de882000..1d2944ae 100644 --- a/pdf/plugin.properties +++ b/pdf/plugin.properties @@ -35,3 +35,10 @@ maven.pdf.cover.version=${pom.currentVersion} #maven.pdf.cover.date=Not defined by default maven.pdf.projectLogo=${pom.logo} maven.pdf.companyLogo=${pom.organization.logo} + +# Jimi or Jai libraries used to generate PNG images +# We use the same syntax as to override a dependency +# Not defined by default +#maven.jar.jimi=${maven.repo.local}/jimi/jars/jimi-X.Y.Z.jar +#maven.jar.jaicore=${maven.repo.local}/jai/jars/jai_core-X.Y.Z.jar +#maven.jar.jaicodec=${maven.repo.local}/jai/jars/jai_codec-X.Y.Z.jar \ No newline at end of file diff --git a/pdf/xdocs/changes.xml b/pdf/xdocs/changes.xml index 8bdc09f2..87c5bb99 100644 --- a/pdf/xdocs/changes.xml +++ b/pdf/xdocs/changes.xml @@ -33,6 +33,7 @@ Cannot use SVG images. batik: java.lang.NoSuchMethodError. Can't insert the logo image described in the POM if its path begins with a slash (as it works for the xdoc plugin). Allow copy and paste from pdf to text editor. + Add support for external imaging libraries like jimi and jai to use PNG images in generated pdf files. Use the ant task for the xsl transformation and remove xerces and xalan dependencies. People using java 5 will have to use this release with maven 1.1 or maven 1.0 with at the most the PDF plugin 2.2.X. diff --git a/pdf/xdocs/faq.fml b/pdf/xdocs/faq.fml index 4827fa3e..5d720a8f 100644 --- a/pdf/xdocs/faq.fml +++ b/pdf/xdocs/faq.fml @@ -22,18 +22,26 @@ How do I use the PDF Plugin ? -
    -
  • Firstly you must call the maven target site to generate all the xdocs files and the image ressources.
  • -
  • Then you can call the pdf target to generate the pdf documentation for your project.
  • -
+

+

    +
  • Firstly you must call the maven target site to generate all the xdocs files and the image ressources.
  • +
  • Then you can call the pdf target to generate the pdf documentation for your project.
  • +
+

+

To automate the pdf creation you can add a post goal to the site like this :

+ + + +]]>
How do I use the PDF Plugin with a multiproject ? -

To generate a PDF from documentations defined in several sub-projects, you must copy all the xdocs files from these projects.

-

Here is an example on how to do it :

- To generate a PDF from documentations defined in several sub-projects, you must copy all the xdocs files from these projects.

+

Here is an example on how to do it :

+ -]]> +]]> +

You can also createa dynamic menu using Velocity macro in your navigation.xml file. For example :

+ + + + + #if ($overviewPageCreate == "true" ) + + #end + + + #foreach ($reactorProject in $multiprojects) + + + #end + + + +]]>
-
+ Which types of images can I use in my documents ? @@ -104,7 +131,7 @@ PNG (Portable Network Graphic) bitmap - JIMI or JAI + JIMI (using the property "maven.jar.jimi") or JAI (using properties "maven.jar.jaicore" and "maven.jar.jaicodec") @@ -120,11 +147,31 @@ TIFF (Tag Image Format File) bitmap - FOP native or JAI, depending on the subformat. See TIFF for more details.(JIMI also supports TIFF, but this has not been implemented within FOP). + FOP native or JAI (using properties "maven.jar.jaicore" and "maven.jar.jaicodec"), depending on the subformat. See TIFF for more details.(JIMI also supports TIFF, but this has not been implemented within FOP). + + How can I insert png images in my pdf ? + +

You must download and put somewhere on your disk JAI or JIMI (on your repository is a good place for it).

+

Then you must register the one you installed with for JIMI :

+ maven.jar.jimi=${maven.repo.local}/jimi/jars/jimi-X.Y.Z.jar +

Or for JAI :

+ maven.jar.jaicore=${maven.repo.local}/jai/jars/jai_core-X.Y.Z.jar +maven.jar.jaicodec=${maven.repo.local}/jai/jars/jai_codec-X.Y.Z.jar +
+
+ + + Technical questions + + Why isn't there a pdf report ? + +

Because reports are generated before the site copies resources like images and the order of reports depends of several parameters. We need that images and generated files are created before we launch the pdf creation. Thus it is not possible to create a pdf report because we can't call it at the end of the site generation process.

+
+
diff --git a/pdf/xdocs/index.xml b/pdf/xdocs/index.xml index 75efae27..cd8c8691 100644 --- a/pdf/xdocs/index.xml +++ b/pdf/xdocs/index.xml @@ -26,6 +26,7 @@

This plug-in allows you to generate a PDF version of your project's documentation.

+

Take a look at goals, the properties and the FAQ to see how to use it.

    diff --git a/pdf/xdocs/properties.xml b/pdf/xdocs/properties.xml index ece7a1dd..b843bca0 100644 --- a/pdf/xdocs/properties.xml +++ b/pdf/xdocs/properties.xml @@ -219,6 +219,22 @@ false + + maven.jar.jimi + Jimi OR Jai libraries must be declared if you want to use PNG images in your pdf document. Jimi and Jai cannot be distributed via ibiblio, so you must add the path to one of these libraries in your project properties. For example : maven.jar.jimi=${maven.repo.local}/jimi/jars/jimi-X.Y.Z.jar + Yes + + Empty. + + + + maven.jar.jaicore
    maven.jar.jaicodec + Jimi OR Jai libraries must be declared if you want to use PNG images in your pdf document. Jimi and Jai cannot be distributed via ibiblio, so you must add the path to one of these libraries in your project properties. For example :
    maven.jar.jaicore=${maven.repo.local}/jai/jars/jai_core-X.Y.Z.jar
    maven.jar.jaicodec=${maven.repo.local}/jai/jars/jai_codec-X.Y.Z.jar
    + Yes + + Empty. + +