Commit 54e87780 authored by Raphaël's avatar Raphaël

Adding of opale_to_pdf folder

parent ec34cd5c
Converter opale_to_pdf
-----------------------
* WARNING : This module is not functionnal yet !
The purpose of this converter is to obtain a PDF file from an Opale document.
The Hdoc pivot format is used to convert one format to another, losing the least amount of information. It is based on HTML.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Thibault DRAIN
* Christophe VIROT
* Pierre Lemaire
* Baptiste PERRAUD
* Raphaël DEBRAY
Dependance
----------
This converter is based on two converters :
* Opale to Hdoc
* Hdoc to Pdf
User documentation
------------------
Unsupported
-----------
Refer to the unsupported elements in Opale to Hdoc and in Hdoc to Pdf.
Known bugs
----------
Refer to the known bugs in Opale to Hdoc and in Hdoc to Pdf.
Todo
----
Technical notes
---------------
The converter contains 1 file:
* opale_to_pdf.ant
It checks wether or not the user specified the parameters and performs the following :
* Copy the input file in the opale_to_hdoc directory.
* Perform the opale_to_hdoc transformation.
* Copy the result in the hdoc_to_pdf directory.
* Perform the hdoc_to_pdf transformation.
* Copy the result in the opale_to_pdf directory.
Capitalisation
--------------
N/A
<project name="ProjetOpale" default="convert">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib.jar" />
</classpath>
</taskdef>
<!-- Arguments properties -->
<property name="DocType" value="paper" />
<property name="Source" value="none" />
<property name="InputPath" value="input" />
<!-- Beginning -->
<target name="convert">
<antcall target="clean_everything" />
<antcall target="opale_to_hdoc" />
<antcall target="hdoc_to_pdf" />
<antcall target="copy_pdf_output" />
</target>
<target name="clean_everything">
<delete dir="../opale_to_hdoc/input"/>
<delete dir="../opale_to_hdoc/output/result.hdoc"/>
<delete dir="../hdoc_to_pdf/input"/>
<delete dir="../hdoc_to_pdf/output/result.pdf"/>
</target>
<target name="opale_to_hdoc">
<!--Check wether there is an input using command line or not-->
<if>
<equals arg1="${Source}" arg2="none" />
<then>
<!--There is no input, check the input folder-->
<echo message="The value of property InputFile is ${Source} ... Checking the input folder" />
<echo message="The value of property DocType is ${DocType}" />
<!-- get input hdoc file path -->
<fileset id="fileset_scar" dir="${InputPath}" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="ScarFile" pathsep="" refid="fileset_scar" />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</then>
<else>
<!--There is an input-->
<echo message="The value of property Source is ${Source}" />
<echo message="The value of property DocType is ${DocType}" />
<echo message="Executing conversion..." />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${Source}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</else>
</if>
</target>
<target name="hdoc_to_pdf">
<copy tofile="../hdoc_to_pdf/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>
<ant antfile="../hdoc_to_pdf/hdoc_to_pdf.ant" inheritAll="false">
<property name="DocType" value="${DocType}"/>
</ant>
</target>
<target name="copy_pdf_output">
<copy tofile="output/result.pdf" file="../hdoc_to_pdf/output/result.pdf"/>
</target>
</project>
@echo off
set lib=lib
set ant=opale_to_pdf.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="opale_to_pdf.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment