diff options
author | Karl Berry <karl@freefriends.org> | 2008-05-10 00:34:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-05-10 00:34:52 +0000 |
commit | 3faea455168abd154168997d2b79fe677fb2afa0 (patch) | |
tree | 8a2f7cc789389ed17d28d6a45053fb36db4c7b0b /Build/source/texk/tex4htk/java/OoFilter.java | |
parent | 3affd633834494c279f96078e95831935ea51ca7 (diff) |
missed new executables
git-svn-id: svn://tug.org/texlive/trunk@8001 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tex4htk/java/OoFilter.java')
-rwxr-xr-x | Build/source/texk/tex4htk/java/OoFilter.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Build/source/texk/tex4htk/java/OoFilter.java b/Build/source/texk/tex4htk/java/OoFilter.java new file mode 100755 index 00000000000..976518eaff4 --- /dev/null +++ b/Build/source/texk/tex4htk/java/OoFilter.java @@ -0,0 +1,60 @@ +package tex4ht; +/**********************************************************/ +/* OoFilterImpl.java 2008-02-20-10:22 */ +/* Copyright (C) 2006--2008 Eitan M. Gurari */ +/* */ +/* This work may be distributed and/or modified under the */ +/* conditions of the LaTeX Project Public License, either */ +/* version 1.3 of this license or (at your option) any */ +/* later version. The latest version of this license is */ +/* in */ +/* http://www.latex-project.org/lppl.txt */ +/* and version 1.3 or later is part of all distributions */ +/* of LaTeX version 2003/12/01 or later. */ +/* */ +/* This work has the LPPL maintenance status "maintained".*/ +/* */ +/* This Current Maintainer of this work */ +/* is Eitan M. Gurari. */ +/* */ +/* gurari@cse.ohio-state.edu */ +/* http://www.cse.ohio-state.edu/~gurari */ +/**********************************************************/ + + +import org.xml.sax.helpers.*; +import org.xml.sax.*; +import java.io.PrintWriter; + +public class OoFilter extends XMLFilterImpl { + PrintWriter out = null; + public OoFilter( PrintWriter out, + PrintWriter log, boolean trace ){ + this.out = out; + } + public void startElement(String ns, String sName, + String qName, Attributes attr) { + if( qName.equals( "draw:frame" ) ){ + String name = attr.getValue("draw:name"); + if( (name != null) + && (attr.getValue("svg:width") == null) + && (attr.getValue("svg:hieght") == null) + ){ + java.awt.Image image = new javax.swing.ImageIcon(name).getImage(); + int width = image.getWidth(null); + int height = image.getHeight(null); + if( (width>0) && (height>0) ){ + org.xml.sax.helpers.AttributesImpl attrs = + new org.xml.sax.helpers.AttributesImpl( attr ); + attrs.addAttribute(null, "svg:width", "svg:width", + "String", (width * 72 / 110) + "pt"); + attrs.addAttribute(null, "svg:width", "svg:height", + "String", (height * 72 / 110) + "pt"); + attr = attrs; + } } } + try{ + super.startElement(ns, sName, qName, attr); + } catch( Exception e ){ + System.err.println( "--- OoFilter Error 1 --- " + e); +} } } + |