
Hi, As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.) I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this? Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Wendell Piez wrote: Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
+1. Sounds like a good candidate for a new built-in scenario, like the XSL-FO -> PDF one. Regards, -- Florent Georges http://fgeorges.org/

Hi Wendell, Thanks for the improvement request, we'll consider it for a future version. Florent Georges' suggestion about integration in the transformation scenarios gave me a workaround for you. You can create a small XSL-FO file which references the image (without any additional text) and performing FO processing using Apache FOP in a modified Oxygen "FO to PDF" transformation scenario in the "FO Processor" tab you can choose from various output methods among which you can find "png" and "tiff": http://www.oxygenxml.com/doc/ug-oxygen/topics/defining-new-transformation-sc... So instead of creating the PDF using Apache FOP you can create an image. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/6/2011 8:15 PM, Wendell Piez wrote:
Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 An Ant transformation scenario would also be good for this. There's a batik ant task. For html outputs, I've included code in my ant script to convert all svgs to png. David On 06/07/2011 06:37 AM, Radu Coravu wrote:
Hi Wendell,
Thanks for the improvement request, we'll consider it for a future version.
Florent Georges' suggestion about integration in the transformation scenarios gave me a workaround for you.
You can create a small XSL-FO file which references the image (without any additional text) and performing FO processing using Apache FOP in a modified Oxygen "FO to PDF" transformation scenario in the "FO Processor" tab you can choose from various output methods among which you can find "png" and "tiff":
http://www.oxygenxml.com/doc/ug-oxygen/topics/defining-new-transformation-sc...
So instead of creating the PDF using Apache FOP you can create an image.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 6/6/2011 8:15 PM, Wendell Piez wrote:
Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN7hhQAAoJEMHeSXG7afUhWfsH/2JuQYcPCz0Emocb9ZuVMUdj uiuDRQcdQzn3Ss6/gRP2IPeFRrXsJsTJpW8AfqTvhnRgJSyS6shgvmabgI6iPMeB SYLandBgbB/7YsekOBNabR58OcN4DV6Ss9/3eyAC6NKTemwOElwbFrDpADP2oU3v uh6qtXWqmakzrWJl+Zay7V0NdB81Uf3LAJ8ATxr/6rfEpG63JkBc2C4KmtF9nZvL sxbvTwt2lz2OBIlGEYAUeF6yN74Fpp6K5RaDcc36DUO8w9A4MPpdT8FjISO2LEWx 4SB0mQhkqDPXpDt5lBXL4k0qxsGy0W8/XiJR4dfekKwR1f6j/8Wgb2hJboN02Qo= =q8/P -----END PGP SIGNATURE-----

Dear Radu, On 6/7/2011 7:37 AM, Radu Coravu wrote:
Florent Georges' suggestion about integration in the transformation scenarios gave me a workaround for you.
You can create a small XSL-FO file which references the image (without any additional text) and performing FO processing using Apache FOP in a modified Oxygen "FO to PDF" transformation scenario in the "FO Processor" tab you can choose from various output methods among which you can find "png" and "tiff":
http://www.oxygenxml.com/doc/ug-oxygen/topics/defining-new-transformation-sc...
So instead of creating the PDF using Apache FOP you can create an image.
Yes, Florent's suggestion gave me this idea too. :-) If I get around to doing this, I'll send the XSLT along. (It'll need XSLT so the file reference and sizing can be dynamic.) Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Radu, It appears to work. ;-) <?xml version="1.0" encoding="UTF-8"?> <fo:root xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:variable name="svg-file" select="document-uri(/)"/> <xsl:variable name="height" select="/svg:svg/@height"/> <xsl:variable name="width" select="/svg:svg/@width"/> <fo:layout-master-set> <fo:simple-page-master master-name="svg" page-height="{$height}" page-width="{$width}"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="svg"> <fo:flow flow-name="xsl-region-body"> <fo:block> <fo:external-graphic src="{$svg-file}"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> Thanks for the idea, Florent. Cheers, Wendell On 6/7/2011 7:37 AM, Radu Coravu wrote:
Hi Wendell,
Thanks for the improvement request, we'll consider it for a future version.
Florent Georges' suggestion about integration in the transformation scenarios gave me a workaround for you.
You can create a small XSL-FO file which references the image (without any additional text) and performing FO processing using Apache FOP in a modified Oxygen "FO to PDF" transformation scenario in the "FO Processor" tab you can choose from various output methods among which you can find "png" and "tiff":
http://www.oxygenxml.com/doc/ug-oxygen/topics/defining-new-transformation-sc...
So instead of creating the PDF using Apache FOP you can create an image.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 6/6/2011 8:15 PM, Wendell Piez wrote:
Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

On Tue, June 7, 2011 5:25 pm, Wendell Piez wrote:
It appears to work. ;-)
<?xml version="1.0" encoding="UTF-8"?> <fo:root xsl:version="2.0"
I like XSL FO as much as the next person (or possibly more), but this seems like overkill. Here is an external tool command line that uses oXygen's Java runtime and oXygen's Batik's rasterizer: "${oxygenInstallDir}/jre/bin/java" -cp "${oxygenInstallDir}/lib/batik-all-1.7.jar${ps}${oxygenInstallDir}/lib/xml-apis-ext.jar" org.apache.batik.apps.rasterizer.Main -scriptSecurityOff -m image/jpeg -d ${cfd}/${cfn}.jpg ${currentFileURL} Works for me on both Linux and Windows. If you run it as is, you'll get a Batik warning about no JPEG resolution setting. The rasterizer command line options are at http://xmlgraphics.apache.org/batik/tools/rasterizer.html#using-binary Regards, Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming

Wendell, This is just too cool - would you mind if I were to use a variation of it for my SVG book? Kurt Cagle Invited Expert, XForms Working Group, W3C Managing Editor, XMLToday.org kurt.cagle@gmail.com 443-837-8725 On Tue, Jun 7, 2011 at 12:25 PM, Wendell Piez <wapiez@mulberrytech.com>wrote:
<?xml version="1.0" encoding="UTF-8"?> <fo:root xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:variable name="svg-file" select="document-uri(/)"/> <xsl:variable name="height" select="/svg:svg/@height"/> <xsl:variable name="width" select="/svg:svg/@width"/>
<fo:layout-master-set> <fo:simple-page-master master-name="svg" page-height="{$height}" page-width="{$width}"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="svg"> <fo:flow flow-name="xsl-region-body"> <fo:block> <fo:external-graphic src="{$svg-file}"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root>

Kurt, Please do. Let me know what improvements you make. (The variables, of course, are superfluous, and help only legibility.) Here's an XSLT 1.0 version (passing the value of the path to the SVG in as a parameter): <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:param name="svg-file" select="''"/> <xsl:variable name="svg" select="document($svg-file)"/> <xsl:variable name="height" select="$svg/*/@height"/> <xsl:variable name="width" select="$svg/*/@width"/> <xsl:template match="/"> <fo:root xsl:version="2.0"> <fo:layout-master-set> <fo:simple-page-master master-name="svg" page-height="{$height}" page-width="{$width}"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="svg"> <fo:flow flow-name="xsl-region-body"> <fo:block> <fo:external-graphic src="{$svg-file}"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> Cheers, Wendell On 6/10/2011 7:32 PM, Kurt Cagle wrote:
Wendell,
This is just too cool - would you mind if I were to use a variation of it for my SVG book?
Kurt Cagle Invited Expert, XForms Working Group, W3C Managing Editor, XMLToday.org kurt.cagle@gmail.com <mailto:kurt.cagle@gmail.com> 443-837-8725
-- ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Hi, An update: Tony Graham suggests doing this as a simple External Tool rather than as a Transformation Scenario, with the command line: "${oxygenInstallDir}/jre/bin/java" -cp "${oxygenInstallDir}/lib/batik-all-1.7.jar${ps}${oxygenInstallDir}/lib/xml-apis-ext.jar" org.apache.batik.apps.rasterizer.Main -scriptSecurityOff -m image/png -d ${cfd}/${cfn}.png ${currentFileURL} This works, and has the advantage of avoiding the overhead of XSLT and FOP, so it is significantly faster. The only downside I can see is that it isn't (yet) possible to bind external tools to particular document types. (Or is it?) Cheers, Wendell On 6/6/2011 1:15 PM, Wendell Piez wrote:
Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I mentioned Ant transformation scenarios before (they're new in 12.2), have you checked them out? Transformation scenarios can live in the framework for a document type. I'm not 100% clear on your use case, but you can invoke batik from ant (use <java> or the batik ant task). Not sure what else you'd be lookinf for. David On 06/08/2011 06:12 PM, Wendell Piez wrote:
Hi,
An update: Tony Graham suggests doing this as a simple External Tool rather than as a Transformation Scenario, with the command line:
"${oxygenInstallDir}/jre/bin/java" -cp "${oxygenInstallDir}/lib/batik-all-1.7.jar${ps}${oxygenInstallDir}/lib/xml-apis-ext.jar" org.apache.batik.apps.rasterizer.Main -scriptSecurityOff -m image/png -d ${cfd}/${cfn}.png ${currentFileURL}
This works, and has the advantage of avoiding the overhead of XSLT and FOP, so it is significantly faster.
The only downside I can see is that it isn't (yet) possible to bind external tools to particular document types. (Or is it?)
Cheers, Wendell
On 6/6/2011 1:15 PM, Wendell Piez wrote:
Hi,
As you know, Batik comes with rasterizer code to convert SVG into JPEG and PNG formats. (And others, including TIFF, EPS and PDF.)
I happily use it on other platforms, but sometimes I'd really like to do this in oXygen ... any chance of adding a widget for SVG files to support this?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN8Bn7AAoJEMHeSXG7afUhk60H/28lnylyX0C/IdK1CUWBheOX fTfUUbbSDkLqfAk8E72UUmFt6RXMOrq17BUxYZxcIbYAd8QaMyKR7f1NeCxgRlsc PzTkGPAvZ34Dpjqnk7OFkuXUKMtoGYGDoob5qORgYcMm7K/OCGXCGtLzAkDOd9lb m4fpgxTMmV07J2/+ItUyxajnDJFxH986wN2fGv/SbLw67bceL/aJoS5+Fmc5w+xI CVl1P+MkmE+dZPHNjebLU/x1tLLBs6IonQLWqaI5WKKJZSeqARypnfEqX3w5AeuS OK/3m2ClNN/8jFQgg/WqIv9b1t1tTqbIz+U80/Jl+x0RX8P/EtJX7zQU2dpXoNA= =J3BR -----END PGP SIGNATURE-----

Wendell Piez wrote: Hi,
The only downside I can see is that it isn't (yet) possible to bind external tools to particular document types. (Or is it?)
Indeed, I think there is no way to define our own processor to use in a scenario. That's an annoying limitation as soon as you want to play with non built-in processors I think. Regards, -- Florent Georges http://fgeorges.org/

On Thu, June 9, 2011 10:09 am, Florent Georges wrote:
Wendell Piez wrote:
The only downside I can see is that it isn't (yet) possible to bind external tools to particular document types. (Or is it?)
Indeed, I think there is no way to define our own processor to use in a scenario. That's an annoying limitation as soon as you want to play with non built-in processors I think.
Yes. I keep wanting to right-click on a file in the "Project view" and run an arbitrary "external tool" on it. Maybe it would help if there was a generic "Java" processor type. Regards, Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming

Hi Tony, I added this idea about invoking external tools on the Project selected file as an improvement request. It seems like an useful addition. I'm slightly confused about the connotation of the word "processor" (FO or External tool). I understand that Florent wanted to add a custom FO processor to be used in the "FO Processor" tab from an XSLT trasformation scenario. Custom FO processors (which are actually defined as external tools) can be added from the "XML / XSLT-FO-XQuery / FO Processors" preferences page. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/9/2011 12:21 PM, Tony Graham wrote:
On Thu, June 9, 2011 10:09 am, Florent Georges wrote:
Wendell Piez wrote:
The only downside I can see is that it isn't (yet) possible to bind external tools to particular document types. (Or is it?)
Indeed, I think there is no way to define our own processor to use in a scenario. That's an annoying limitation as soon as you want to play with non built-in processors I think.
Yes. I keep wanting to right-click on a file in the "Project view" and run an arbitrary "external tool" on it.
Maybe it would help if there was a generic "Java" processor type.
Regards,
Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Radu Coravu wrote:
I'm slightly confused about the connotation of the word "processor" (FO or External tool). I understand that Florent wanted to add a custom FO processor to be used in the "FO Processor" tab from an XSLT trasformation scenario. Custom FO processors (which are actually defined as external tools) can be added from the "XML / XSLT-FO-XQuery / FO Processors" preferences page.
Actually, as far as I know, this allows one to add his/her own FOP processor. More generally, I talked about the ability to define an external tool and be able to use it in a scenario in the drop down lists for "XSLT Transformer", "XQuery processor", "FO processor", etc. Regards, -- Florent Georges http://fgeorges.org/

Hi Florent, In the Oxygen Preferences->"XML / XSLT-FO-XQuery / Custom Engines" page you can define custom XSLT and XQuery processors (which are actually also external command line tools) which are then visible in the drop down processor combos when defining XSLT or XQuery scenarios. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/9/2011 1:28 PM, Florent Georges wrote:
Radu Coravu wrote:
I'm slightly confused about the connotation of the word "processor" (FO or External tool). I understand that Florent wanted to add a custom FO processor to be used in the "FO Processor" tab from an XSLT trasformation scenario. Custom FO processors (which are actually defined as external tools) can be added from the "XML / XSLT-FO-XQuery / FO Processors" preferences page.
Actually, as far as I know, this allows one to add his/her own FOP processor. More generally, I talked about the ability to define an external tool and be able to use it in a scenario in the drop down lists for "XSLT Transformer", "XQuery processor", "FO processor", etc.
Regards,

Radu Coravu wrote:
In the Oxygen Preferences->"XML / XSLT-FO-XQuery / Custom Engines" page you can define custom XSLT and XQuery processors (which are actually also external command line tools) which are then visible in the drop down processor combos when defining XSLT or XQuery scenarios.
He he, exactly what I meant ;-) So it should be possible to create a Batik "transformer", which would get SVG as input and output a PNG in its output file, and then use it in a scenario, isn't it? Regards, -- Florent Georges http://fgeorges.org/

Florent, On 6/9/2011 9:07 AM, Florent Georges wrote:
In the Oxygen Preferences->"XML / XSLT-FO-XQuery / Custom Engines" page you can define custom XSLT and XQuery processors (which are actually also external command line tools) which are then visible in the drop down processor combos when defining XSLT or XQuery scenarios.
He he, exactly what I meant ;-)
So it should be possible to create a Batik "transformer", which would get SVG as input and output a PNG in its output file, and then use it in a scenario, isn't it?
Well ... part of the goal here (at least in my case) is something that would be available for SVG inputs, but would not otherwise clutter the application or UI. (The use case I have in mind is for users who are not inclined to mess too much with what they see as internals. So I want something really easy to deploy, if it's not already built in.) I know that's a bit of scope creep from the initial problem statement, but c'est la vie. Of the methods suggested so far, wrapping the rasterizer in XSLT/XSL-FO would allow this, since such a transformation could (given the necessary permissions) be set up inside the SVG framework. If frameworks were to support external processes generally, and not only their own suite of transformation scenarios, than the simple command line call (which has the virtue of the most efficient use of resources) could also work this way. Setting up the rasterizer as a (de jure) "transformation engine" is an interesting idea (and a devilish one), but having done that I don't think this option will be as well-hidden from non-SVG input, on which of course the routine will give only errors. For now, I can put the tool into a Project for my client and document how to make it more widely available should they want to do that. (I don't think I'll have them mess with their SVG framework.) Cheers, Wendell -- ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

On Thu, June 9, 2011 4:31 pm, Wendell Piez wrote: ...
Of the methods suggested so far, wrapping the rasterizer in XSLT/XSL-FO would allow this, since such a transformation could (given the necessary permissions) be set up inside the SVG framework.
Just for fun (and a future blog post): ------------------------------- Custom FO processor command line: "${oxygenInstallDir}/jre/bin/java" -cp "${oxygenInstallDir}/lib/batik-all-1.7.jar${ps}${oxygenInstallDir}/lib/xml-apis-ext.jar" org.apache.batik.apps.rasterizer.Main -scriptSecurityOff -m image/jpeg -d ${out} ${fo} When configuring the transformation scenario, select "XML URL as input" in the "FO Processor" tab and use "${cfd}\${cfn}.jpg" as the output file. --------------------------------- Ant transformation scenario build file: <?xml version="1.0" encoding="UTF-8"?> <project> <!-- <oXygen/>-related properties. --> <property name="pd" value="."/> <property name="cfd" value="."/> <property name="cfn" value="."/> <property name="cfne" value="."/> <property name="oxygenInstallDir" value="."/> <target name="rasterize"> <java classname="org.apache.batik.apps.rasterizer.Main" fork="yes"> <classpath> <pathelement location="${oxygenInstallDir}/lib/batik-all-1.7.jar"/> <pathelement location="${oxygenInstallDir}/lib/xml-apis-ext.jar"/> </classpath> <arg value="-scriptSecurityOff"/> <arg value="-m"/> <arg value="image/jpeg"/> <arg value="-d"/> <arg value="${cfd}/${cfn}.jpg"/> <arg value="${cfne}"/> </java> </target> </project> I couldn't find the rasterizer task in oXygen's libraries so I ran it directly. I couldn't get it to run without 'fork="yes"' because I couldn't set the Java security permissions properly. When configuring the Ant transformation, the dialog box for the undocumented(?) 'Libraries' button has the title "Edit extensions". Is that correct? ----------------------------------------- XProc script file: <?xml version="1.0" encoding="UTF-8"?> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"> <p:option name="cfd" required="true"/> <p:option name="cfn" required="true"/> <p:option name="cfne" required="true"/> <p:option name="oxygenInstallDir" required="true"/> <p:exec result-is-xml="false" arg-separator="#"> <p:input port="source"> <p:empty/> </p:input> <p:with-option name="command" select="concat($oxygenInstallDir,'/jre/bin/java')"/> <p:with-option name="args" select="concat('-cp#',$oxygenInstallDir,'/lib/batik-all-1.7.jar;',$oxygenInstallDir,'/lib/xml-apis-ext.jar#org.apache.batik.apps.rasterizer.Main#-scriptSecurityOff#-m#image/jpeg#-d#',$cfd,'/',$cfn,'.jpg#',$cfne)"/> <p:with-option name="cwd" select="$cfd"/> </p:exec> <p:sink/> </p:declare-step> Having to build the 'args' option that way was less than convenient. ---------------------------------------- Finally, when right-clicking on a file in the Project View and selecting "Configure Transformation Scenario...", the list of available transforms isn't filtered by transformation type as it is when you click on the "Configure Transformation Scenario" button in the toolbar. Regards, Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming

Hi Tony, Just to answer to some indirect Oxygen observations:
When configuring the Ant transformation, the dialog box for the undocumented(?) 'Libraries' button has the title "Edit extensions". Is that correct?
Indeed the dialog title is not quite intuitive. We'll probably change the title to "Edit Libraries" (and also update the user manual). Thanks for the tip.
Finally, when right-clicking on a file in the Project View and selecting "Configure Transformation Scenario...", the list of available transforms isn't filtered by transformation type as it is when you click on the "Configure Transformation Scenario" button in the toolbar.
Yes, the Project does not have such a good detection of the type of XML the transformation scenarios will be configured for. I added an improvement request and we'll try to correct this in a future version. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/10/2011 7:09 PM, Tony Graham wrote:
On Thu, June 9, 2011 4:31 pm, Wendell Piez wrote: ...
Of the methods suggested so far, wrapping the rasterizer in XSLT/XSL-FO would allow this, since such a transformation could (given the necessary permissions) be set up inside the SVG framework.
Just for fun (and a future blog post):
------------------------------- Custom FO processor command line:
"${oxygenInstallDir}/jre/bin/java" -cp "${oxygenInstallDir}/lib/batik-all-1.7.jar${ps}${oxygenInstallDir}/lib/xml-apis-ext.jar" org.apache.batik.apps.rasterizer.Main -scriptSecurityOff -m image/jpeg -d ${out} ${fo}
When configuring the transformation scenario, select "XML URL as input" in the "FO Processor" tab and use "${cfd}\${cfn}.jpg" as the output file. --------------------------------- Ant transformation scenario build file:
<?xml version="1.0" encoding="UTF-8"?> <project> <!--<oXygen/>-related properties. --> <property name="pd" value="."/> <property name="cfd" value="."/> <property name="cfn" value="."/> <property name="cfne" value="."/> <property name="oxygenInstallDir" value="."/>
<target name="rasterize"> <java classname="org.apache.batik.apps.rasterizer.Main" fork="yes"> <classpath> <pathelement location="${oxygenInstallDir}/lib/batik-all-1.7.jar"/> <pathelement location="${oxygenInstallDir}/lib/xml-apis-ext.jar"/> </classpath> <arg value="-scriptSecurityOff"/> <arg value="-m"/> <arg value="image/jpeg"/> <arg value="-d"/> <arg value="${cfd}/${cfn}.jpg"/> <arg value="${cfne}"/> </java> </target> </project>
I couldn't find the rasterizer task in oXygen's libraries so I ran it directly.
I couldn't get it to run without 'fork="yes"' because I couldn't set the Java security permissions properly.
When configuring the Ant transformation, the dialog box for the undocumented(?) 'Libraries' button has the title "Edit extensions". Is that correct? ----------------------------------------- XProc script file:
<?xml version="1.0" encoding="UTF-8"?> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
<p:option name="cfd" required="true"/> <p:option name="cfn" required="true"/> <p:option name="cfne" required="true"/> <p:option name="oxygenInstallDir" required="true"/>
<p:exec result-is-xml="false" arg-separator="#"> <p:input port="source"> <p:empty/> </p:input> <p:with-option name="command" select="concat($oxygenInstallDir,'/jre/bin/java')"/> <p:with-option name="args" select="concat('-cp#',$oxygenInstallDir,'/lib/batik-all-1.7.jar;',$oxygenInstallDir,'/lib/xml-apis-ext.jar#org.apache.batik.apps.rasterizer.Main#-scriptSecurityOff#-m#image/jpeg#-d#',$cfd,'/',$cfn,'.jpg#',$cfne)"/> <p:with-option name="cwd" select="$cfd"/> </p:exec> <p:sink/> </p:declare-step>
Having to build the 'args' option that way was less than convenient. ----------------------------------------
Finally, when right-clicking on a file in the Project View and selecting "Configure Transformation Scenario...", the list of available transforms isn't filtered by transformation type as it is when you click on the "Configure Transformation Scenario" button in the toolbar.
Regards,
Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

BTW: It would be nice to have an option for passing parameters to the custom engine, especially from the transformation scenario. At this time, one has to create an different custom processor for each combination of parameters. I think, the simplest way would be the use of ${MyParameterName} in the command line box. Thanks, Stefan Am 09.06.2011 13:04, schrieb Radu Coravu:
Hi Florent,
In the Oxygen Preferences->"XML / XSLT-FO-XQuery / Custom Engines" page you can define custom XSLT and XQuery processors (which are actually also external command line tools) which are then visible in the drop down processor combos when defining XSLT or XQuery scenarios.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 6/9/2011 1:28 PM, Florent Georges wrote:
Radu Coravu wrote:
I'm slightly confused about the connotation of the word "processor" (FO or External tool). I understand that Florent wanted to add a custom FO processor to be used in the "FO Processor" tab from an XSLT trasformation scenario. Custom FO processors (which are actually defined as external tools) can be added from the "XML / XSLT-FO-XQuery / FO Processors" preferences page.
Actually, as far as I know, this allows one to add his/her own FOP processor. More generally, I talked about the ability to define an external tool and be able to use it in a scenario in the drop down lists for "XSLT Transformer", "XQuery processor", "FO processor", etc.
Regards,
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Stefan, We already have this feature request registered on our issues list (you reported it a while ago). It is currently scheduled for Oxygen 14 (probably next year) but I cannot give an exact estimate. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/9/2011 7:29 PM, Stefan Krause wrote:
BTW: It would be nice to have an option for passing parameters to the custom engine, especially from the transformation scenario. At this time, one has to create an different custom processor for each combination of parameters.
I think, the simplest way would be the use of ${MyParameterName} in the command line box.
Thanks,
Stefan
Am 09.06.2011 13:04, schrieb Radu Coravu:
Hi Florent,
In the Oxygen Preferences->"XML / XSLT-FO-XQuery / Custom Engines" page you can define custom XSLT and XQuery processors (which are actually also external command line tools) which are then visible in the drop down processor combos when defining XSLT or XQuery scenarios.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 6/9/2011 1:28 PM, Florent Georges wrote:
Radu Coravu wrote:
I'm slightly confused about the connotation of the word "processor" (FO or External tool). I understand that Florent wanted to add a custom FO processor to be used in the "FO Processor" tab from an XSLT trasformation scenario. Custom FO processors (which are actually defined as external tools) can be added from the "XML / XSLT-FO-XQuery / FO Processors" preferences page.
Actually, as far as I know, this allows one to add his/her own FOP processor. More generally, I talked about the ability to define an external tool and be able to use it in a scenario in the drop down lists for "XSLT Transformer", "XQuery processor", "FO processor", etc.
Regards,
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (7)
-
David Cramer
-
Florent Georges
-
Kurt Cagle
-
Radu Coravu
-
Stefan Krause
-
Tony Graham
-
Wendell Piez