You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Paul Bolger <pb...@gmail.com> on 2006/07/11 03:10:09 UTC
graphics and the odt plugin
Has anyone had any luck getting the odt plugin to translate graphics
from a source document yet?
Re: graphics and the odt plugin
Posted by Paul Bolger <pb...@gmail.com>.
Thanks for the clarification. I'll give that patch a run and see how I go.
Ross: the OOo plugin works well but is a bit hamstrung by the fact
that Openoffice 2 will only batch convert to odt. I can't remember
whether OOo1 did batch importing at all, and I'm afraid I can't be
bothered having multiple OpenOffices hanging around. As stated
previously MSWord to Forrest would be easier still, but I never did
get your plugin going.
The urgency waned somewhat when the client lost interest (the person
driving the project left), and I got a full-time job.
Congrats to both of you on your kids, although I'm not sure about life
being 'about to start' - I can't really remember the first three
months of my daughter's life, a blur of being woken up, vomited on,
etc. I think nature blanks it out to some extent, so you don't avoid
doing it again...
Paul Bolger
On 12/07/06, Web Maestro Clay <th...@gmail.com> wrote:
>
>
> On Jul 11, 2006, at 1:38 PM, Ross Gardler wrote:
> Web Maestro Clay wrote:
> On Jul 10, 2006, at 6:17 PM, Ross Gardler wrote:
> and then had some more pressing 'issues' to deal with (like a newborn...).
>
> Many congratulations. If this is your first, your life is about to start. If
> it is not your first then you know more about it than me ;-)
>
> Ross
>
> Thanks... It's my 2nd, and I've still got a lot to learn!
>
>
>
> Web Maestro Clay
> the.webmaestro@gmail.com
>
> My religion is simple. My religion is kindness.
> -- HH Dalai Lama of Tibet
>
>
>
>
Re: graphics and the odt plugin
Posted by Web Maestro Clay <th...@gmail.com>.
On Jul 11, 2006, at 1:38 PM, Ross Gardler wrote:
> Web Maestro Clay wrote:
>> On Jul 10, 2006, at 6:17 PM, Ross Gardler wrote:
>> and then had some more pressing 'issues' to deal with (like a
>> newborn...).
>
> Many congratulations. If this is your first, your life is about to
> start. If it is not your first then you know more about it than me ;-)
>
> Ross
Thanks... It's my 2nd, and I've still got a lot to learn!
Web Maestro Clay
the.webmaestro@gmail.com
My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet
Re: graphics and the odt plugin
Posted by Ross Gardler <rg...@apache.org>.
Web Maestro Clay wrote:
> On Jul 10, 2006, at 6:17 PM, Ross Gardler wrote:
>
> and then had some
> more pressing 'issues' to deal with (like a newborn...).
Many congratulations. If this is your first, your life is about to
start. If it is not your first then you know more about it than me ;-)
Ross
Re: graphics and the odt plugin
Posted by Web Maestro Clay <th...@gmail.com>.
On Jul 10, 2006, at 6:17 PM, Ross Gardler wrote:
> Paul Bolger wrote:
>> Has anyone had any luck getting the odt plugin to translate graphics
>> from a source document yet?
>
> I've not looked at the ODT plugin and am unlikely to do so in the
> forseeable future. However, I will mention again that I spent some
> time making this work in the original OOo plugin. I don't believe
> the two formats are that different that we cant reuse the same
> solution.
>
> Ross
I was able to get graphics to display with the ODT plugin. I'll paste
my `svn diff` below.
NOTE: Unfortunately, it broke the OOo plugin's ability to process
images (which I still use to convert an OOo Impress file). I believe
my serializer 'hi-jacked' or 'superceded' the graphics portion of the
OOo Impress converter.
Hopefully you'll get some ideas here. I got stuck, and then had some
more pressing 'issues' to deal with (like a newborn...).
[clay@Clays-PB org.apache.forrest.plugin.input.odt]$ svn diff
Index: input.xmap
===================================================================
--- input.xmap (revision 411040)
+++ input.xmap (working copy)
@@ -49,6 +49,16 @@
<map:serialize type="xml" />
</map:match>
</map:pipeline>
+
+ <!-- Image Pipeline -->
+ <map:pipeline internal="true">
+ <map:match pattern="openDocumentEmbeddedImage/zip-{1}.odt/file-
**.*">
+ <map:read src="jar:file:///{lm:project.{1}!/{2}.{3}}" mime-
type="image/{3}" />
+ </map:match>
+ <map:match pattern="**/openDocumentEmbeddedImage/zip-{1}.odt/
file-**.*">
+ <map:read src="jar:file:///{lm:project.{1}/{2}!/{3}.{4}}"
mime-type="image/{4}" />
+ </map:match>
+ </map:pipeline>
</map:pipelines>
</map:sitemap>
Index: resources/stylesheets/odt-to-forrest-xhtml.xsl
===================================================================
--- resources/stylesheets/odt-to-forrest-xhtml.xsl (revision
411040)
+++ resources/stylesheets/odt-to-forrest-xhtml.xsl (working copy)
@@ -18,6 +18,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/" >
@@ -57,4 +58,14 @@
</body>
</html>
</xsl:template>
+
+ <!--+
+ | Images
+ +-->
+ <xsl:template match="draw:image[@xlink:show]">
+ <xsl:variable name="href"><xsl:value-of select="@xlink:href"/></
xsl:variable>
+ <img src="openDocumentEmbeddedImage/zip-{$filename}.odt/file-
{$href}"
+ alt="{@draw:name}" class="{./../@draw:style-name}" />
+ </xsl:template>
+
</xsl:stylesheet>
Web Maestro Clay
the.webmaestro@gmail.com
My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet
Re: graphics and the odt plugin
Posted by Ross Gardler <rg...@apache.org>.
Paul Bolger wrote:
> Has anyone had any luck getting the odt plugin to translate graphics
> from a source document yet?
I've not looked at the ODT plugin and am unlikely to do so in the
forseeable future. However, I will mention again that I spent some time
making this work in the original OOo plugin. I don't believe the two
formats are that different that we cant reuse the same solution.
Ross