Blame Scripts/Bash/Functions/Render/Docbook/docbook_convertToPdf.sh

878a2b
#!/bin/bash
878a2b
#
878a2b
# docbook_convertToPdf.sh -- This function takes DocBook XML as input
878a2b
# and produces two different PDF as outputs; one from DocBook XML and
878a2b
# another from DocBook SGML.  We decided to provide support for both
878a2b
# ways of output production from DocBook XML and DocBook SGML for you
878a2b
# to evaluate and if possible correct.
878a2b
#
878a2b
# Copyright (C) 2009, 2010, 2011 The CentOS Project
878a2b
#
878a2b
# This program is free software; you can redistribute it and/or modify
878a2b
# it under the terms of the GNU General Public License as published by
878a2b
# the Free Software Foundation; either version 2 of the License, or (at
878a2b
# your option) any later version.
878a2b
#
878a2b
# This program is distributed in the hope that it will be useful, but
878a2b
# WITHOUT ANY WARRANTY; without even the implied warranty of
878a2b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
878a2b
# General Public License for more details.
878a2b
#
878a2b
# You should have received a copy of the GNU General Public License
878a2b
# along with this program; if not, write to the Free Software
878a2b
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
878a2b
#
878a2b
# ----------------------------------------------------------------------
878a2b
# $Id$
878a2b
# ----------------------------------------------------------------------
878a2b
878a2b
function docbook_convertToPdf {
878a2b
878a2b
    # Tranform DocBook XML to PDF.
878a2b
    docbook_convertToPdfFromXml
878a2b
878a2b
    # Tranform DocBook SGML to PDF. 
878a2b
    if [[ $(cli_getCurrentLocale) =~ '^en' ]];then
878a2b
        # FIXME: This is only possible when no localization is
878a2b
        # performed (i.e., xml2po is not involved.) to main DocBook
878a2b
        # file, otherwise there will be errors and the PDF output
878a2b
        # won't be created. The errors come out because when we passed
878a2b
        # the validated DocBook file to xml2po all XML decimal
878a2b
        # entities inside the main DocBook file are expanded and set
878a2b
        # in the msgid field. Such expanded characters are not
878a2b
        # recognized by openjade when they are used as source to
878a2b
        # produce the PDF output. 
878a2b
        docbook_convertToPdfFromSgml
878a2b
    fi
878a2b
878a2b
}