tkormann 01/11/19 01:28:24 Modified: xdocs index.xml rasterizerTutorial.xml whoAreWe.xml Log: - fix bio - fix typo in Transcoder tutorial - add a new section in the transcoder tutorial to illustrate the other hints Revision Changes Path 1.33 +2 -2 xml-batik/xdocs/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/index.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- index.xml 2001/11/12 16:34:33 1.32 +++ index.xml 2001/11/19 09:28:24 1.33 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: index.xml,v 1.32 2001/11/12 16:34:33 vhardy Exp $ --> +<!-- version $Id: index.xml,v 1.33 2001/11/19 09:28:24 tkormann Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -116,7 +116,7 @@ <anchor id="projectAndProductExamples" /> <s1 title="Examples of projects and products using Batik"> - <p>While it is hard to track projects are products which are using Batik, here are a few + <p>While it is hard to track projects and products which are using Batik, here are a few ones which are known:</p> <ul> <li><link href="http://xml.apache.org/fop">The Apache FOP project</link> uses Batik to handle SVG images. It uses the SVG rasterizer and extends the Batik transcoder 1.7 +108 -8 xml-batik/xdocs/rasterizerTutorial.xml Index: rasterizerTutorial.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/rasterizerTutorial.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- rasterizerTutorial.xml 2001/02/16 09:28:33 1.6 +++ rasterizerTutorial.xml 2001/11/19 09:28:24 1.7 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: rasterizerTutorial.xml,v 1.6 2001/02/16 09:28:33 tkormann Exp $ --> +<!-- version $Id: rasterizerTutorial.xml,v 1.7 2001/11/19 09:28:24 tkormann Exp $ --> <!-- ========================================================================= --> <document> @@ -135,8 +135,6 @@ // create a JPEG transcoder <strong>JPEGTranscoder t = new JPEGTranscoder();</strong> // set the transcoding hints - <strong>t.addTranscodingHint(JPEGTranscoder.KEY_XML_PARSER_CLASSNAME, - "org.apache.crimson.parser.XMLReaderImpl");</strong> <strong>t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.8));</strong> // create the transcoder input @@ -224,8 +222,6 @@ JPEGTranscoder trans = new JPEGTranscoder(); public SaveAsJPEGTiles() { - trans.addTranscodingHint(JPEGTranscoder.KEY_XML_PARSER_CLASSNAME, - "org.apache.crimson.parser.XMLReaderImpl"); trans.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.8)); } @@ -286,6 +282,110 @@ </ol> </s2> +<s2 title="Other Transcoding Hints"> +<p> + +The <code>ImageTranscoder</code> provides additional +<code>TranscodingHints</code> that lets you customize the generated +images. +</p> + +<dl> +<dt><code>ImageTranscoder.KEY_MEDIA</code></dt> +<dd> + +This hint lets you choose the CSS medium to use. The author of the SVG document +to transcode can control CSS media using the <link +href="http://www.w3.org/TR/REC-CSS2/media.html">CSS media rule</link>. Example: + +<br /> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "print"); +</code> +<br /> +<br /> +</dd> + +<dt><code>ImageTranscoder.KEY_ALTERNATE_STYLESHEET</code></dt> +<dd> + +This hint lets you choose an alternate stylesheet the author of the SVG +document to transcode might have provided. Example: + +<br /> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_ALTERNATE_STYLESHEET, alternateStylesheetName); +</code> +<br /> +<br /> +</dd> + +<dt><code>ImageTranscoder.KEY_USER_STYLESHEET_URI</code></dt> +<dd> + +This hint lets you use a user stylesheet. User stylesheet can override some +styles of the SVG document to transcode. Example: + +<br /> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_ALTERNATE_STYLESHEET, "http://..."); +</code> +<br /> +<br /> +</dd> + +<dt><code>ImageTranscoder.KEY_PIXEL_TO_MM</code></dt> +<dd> + +This hint lets you use the pixel to millimeter conversion factor. This factor +is used to determine how units are converted into pixels. Example: + +<br /> +<br /> +<code>// 96dpi</code> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_PIXEL_TO_MM, new Float(0.2645833f)); +</code> +<br /> +<br /> +or +<br /> +<br /> +<code> +// 72dpi +</code> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_PIXEL_TO_MM, new Float(0.3528f)); +</code> +<br /> +<br /> +</dd> + +<dt><code>ImageTranscoder.KEY_BACKGROUND_COLOR</code></dt> +<dd> + +This hint lets you choose a background color. Example: + +<br /> +<br /> +<code> +trans.addTranscodingHint(ImageTranscoder.KEY_BACKGROUND_COLOR, Color.white); +</code> +<br /> +<br /> +</dd> + +</dl> + + +</s2> + + <s2 title="Generating an Image from a SVG DOM Tree"> <p> The following code creates and saves a SVG DOM tree. @@ -365,13 +465,13 @@ create a <code>org.w3c.dom.Document</code> (which is a SVG Document by the way) by invoking the <code>createDocument</code> method with the svg namespace URI and the "svg" document element. At last, you can get -the document element and start to build your DOM tree. <br /><br /> +the document element and start building your DOM tree. <br /><br /> </dd> <dt>Rasterizing your DOM</dt> <dd> <br />See the <code>save</code> method<br /> Similar to the previous examples, you can transcode a SVG document to a raster image by -creating a <code>TransocderInput</code> with this time, the SVG Document. +creating a <code>TranscoderInput</code> with this time, the SVG Document. <br /><br /> </dd> </dl> @@ -390,4 +490,4 @@ </body> </document> - \ No newline at end of file + 1.30 +9 -8 xml-batik/xdocs/whoAreWe.xml Index: whoAreWe.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/whoAreWe.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- whoAreWe.xml 2001/11/07 08:54:22 1.29 +++ whoAreWe.xml 2001/11/19 09:28:24 1.30 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: whoAreWe.xml,v 1.29 2001/11/07 08:54:22 vhardy Exp $ --> +<!-- version $Id: whoAreWe.xml,v 1.30 2001/11/19 09:28:24 tkormann Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -114,13 +114,14 @@ <dt>Thierry Kormann (TK)</dt><dd><br /> <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link> <br /> - <em>Thierry is a software engineer, at the Koala project of - ILOG located at INRIA Sophia Antipolis, France. Thierry has - contributed to most of the Koala's projects involving Java - and XML. Since then, he co-founded the Apache Batik project. - His daytime job is focused on Graphics and XML related - technologies. Prior to joining ILOG, Thierry worked as a - software engineer for Bull.</em> + <em> + +Thierry is a software engineer, at the Koala project of ILOG located at INRIA +Sophia Antipolis, France and a member of the SVG working group. Thierry has +contributed to most of the Koala's projects involving Java and XML. Since +then, he co-founded the Apache Batik project. His daytime job is focused on +Graphics and XML related technologies. Prior to joining ILOG, Thierry worked +as a software engineer for Bull.</em> <br /><br /> </dd>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]