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 ..

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.



<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook"; version="5.0" xml:lang="en"
    <title>Document information</title>

      <holder>Fredrik Svensson</holder>

    <bibliorelation class="uri" type="isreplacedby">
      latest version of this document</link>
	<revremark>first draft</revremark>

	This Work is licensed under a Creative Commons
	Attribution-NonCommercial-NoDerivs 2.5 Sweden</link> License.
	    <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"
		<use y="0" x="64" height="64" width="64" transform="translate(0.0 -184.308)"
		<use y="0" x="128" height="64" width="64" transform="translate(-118.505 0.0)"
		<use y="0" x="192" height="64" width="64" transform="translate(0.0 -368.617)"
	      <image y="0" x="4000" height="1000" width="1600"
	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.
      	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.

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