OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: FOP - SVG - Legalnotice - CC


Hi all,

How to add CC svg graphics direct in pdf with fop + current batik.


I have been writing some texts in Docbook that I might put online.
They are not yet ready, but I figured I should have a look at the legal
section. I wanted to add a CC license.

As I was doing that I figured it would be nice to add the nice
CC logos, to have an easy to understand license.

Looking at http://labs.creativecommons.org/ they can generate me
a 88x31.png.. not very nice for pdfs.

So I went to the website, had a look and found svgs in the presskit.
I whipped together a svg that would mix everything I needed
(see attachment test.en.xml in imageobject)
Warning, I am not a designer..

fop does not handle the SVG (as it has use and image parts) but with the 
current batik trunk library and fop trunk it works. I also tested XEP and it 
also works.

I am running Debian sid, so if some library is missing it should
be available in sid as a package.

Getting fop up to spiff :
=========================

#  First get the latest batik (trunk, 1.7-beta)
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
svn checkout http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/ batik
cd batik
./build.sh all-jar
cd ..
#  Now get fop
svn checkout http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/ fop
cd fop
#  Include the new batik lib
cd lib
cp ../../batik/batik-1.7/lib/batik-all.jar .
# need to get org.w3c.dom.svg
cp ../../batik/lib/xml-apis-ext.jar .
cd ..
ant

Testing the setup:
==================
# get the test.en.xml and swe-flag.svg  to the fop directory
xsltproc --output test.fo 
/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl test.en.xml
./fop test.fo test.pdf
xpdf test.pdf

Hope it helped someone. Also for people who not need a CC tag, but
want to throw some nice SVG graphic in the mix.

/Fred

image/svg

<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook"; version="5.0" xml:lang="en"
      xmlns:xi="http://www.w3.org/2001/XInclude";>
  <title>Testdocument</title>
  <info>
    <title>Document information</title>
    <author>
      <personname>
      <firstname>Fredrik</firstname><surname>Svensson</surname>
      </personname>
      <email>fred@ludd.ltu.se</email>
    </author>
    
    <pubdate>2007-11-15</pubdate>

    <copyright>
      <year>2007</year>
      <holder>Fredrik Svensson</holder>
    </copyright>

    <bibliorelation class="uri" type="isreplacedby">
      <link
      href="http://localhost/test.en.xml";>The
      latest version of this document</link>
    </bibliorelation>
    <revhistory>
      <revision>
	<revnumber>0.1</revnumber>
	<date>2007-11-15</date>
	<authorinitials>FS</authorinitials>
	<revremark>first draft</revremark>
      </revision>
    </revhistory>

    <legalnotice>
      <title>Licence</title>
      <para>
	This Work is licensed under a Creative Commons
	<link
	href="http://creativecommons.org/licenses/by-nc-nd/2.5/se/";>
	Attribution-NonCommercial-NoDerivs 2.5 Sweden</link> License.
	<mediaobject>
	  <imageobject>
	    <svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";
		  height="1cm" width="5.6cm" viewBox="0 0 5600 1000" version="1.1">
	      <g transform="scale(15.625)">
		<image y="0" x="0" height="64" width="64"
		       xlink:href="http://mirrors.creativecommons.org/presskit/cc.logo.circle.svg"/>
		<use y="0" x="64" height="64" width="64" transform="translate(0.0 -184.308)"
		     xlink:href="http://mirrors.creativecommons.org/presskit/cc.deed.icons.svg#g35"/>
		<use y="0" x="128" height="64" width="64" transform="translate(-118.505 0.0)"
		     xlink:href="http://mirrors.creativecommons.org/presskit/cc.deed.icons.svg#path43"/>
		<use y="0" x="192" height="64" width="64" transform="translate(0.0 -368.617)"
		     xlink:href="http://mirrors.creativecommons.org/presskit/cc.deed.icons.svg#g5"/>
	      </g> 
	      <image y="0" x="4000" height="1000" width="1600"
		     xlink:href="file:swe-flag.svg"/>
	    </svg>
	  </imageobject>
	</mediaobject>
      </para>
    </legalnotice>
    <legalnotice>
      <title>Disclaimer</title>
      <para>
	No liability for the contents of this document can be
	accepted. Use the concepts, examples and information at your
	own risk. There may be errors and inaccuracies, that could be
	damaging to your system. Proceed with caution, and although it
	is highly unlikely that accidents will happen because of
	following advice or procedures described in this document, the
	author(s) do not take any responsibility for any damage
	claimed to be caused by doing so.
      </para>
      <para>
      	All copyrights are held by their by their respective owners,
      	unless specifically noted otherwise. Use of a term in this
      	document should not be regarded as affecting the validity of
      	any trademark or service mark. Naming of particular products
      	or brands should not be seen as endorsements.
      </para>
    </legalnotice>
  </info>
  <chapter>
    <title>Title</title>
    <para>
      Text
    </para>
  </chapter>
</book>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]