RE: XProc-based rasterizer

Hi Wendell,

 

I use a custom built step around aspose imaging 

https://products.aspose.com/imaging/java/

 

so I use a mox:convert-image step (that does take a few options)

 

I love the fact that it is a (special) step so I can just p:for-each on
every image in a MS Word docx package and give me the png from it
(regardless the type, though I prevent png from being converted to png
through a logic not shown here)

Something like this (cut some irrelevant parts out)

 

            <p:for-each mox:threads="{$threads-images}">
                <p:with-input pipe="@media-images"/>
                    <mox:convert-image>
                        <p:with-option name="content-type"
select="'image/png'"/>
                    </mox:convert-image>
                <p:store
                    href="{$out}{string-join(tokenize($fname,
'\.')[not(position() = last())], '.')}.png"/>
                <mox:profile-image/>
            </p:for-each>



This piece stores the resulting png and has a result image profile on the
output port

It works well for me, and it shows binaries flowing through the pipes

 

Downside, I pay for the aspose imagine license

 

Not sure it is what you would qualify as "nice or easy way to do this"

But I like it and I think it is pretty XProcy

 

Best

Geert

 

From: Wendell Piez <wapiez@wendellpiez.com> 
Sent: Friday, 7 March 2025 16:32
To: XProc Dev <xproc-dev@w3.org>
Subject: XProc-based rasterizer

 

Hello XProc friends,

 

Some XProc processors can produce PDF files using XSL-FO (given a suitable
XSL-FO engine), but what about producing PNG from SVG?

 

The FOP processor integrates Apache Batik for SVG support, and Batik can do
the job. Can an XProc processor invoke Batik directly to convert SVG to a
supported raster format? What would that look like, for XML Calabash for
example (which comes with FOP, I think)?

 

Or is there some other nice or easy way to do this using XProc?

 

Thanks for any ideas or experience --

Wendell

 

-- 

...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
... <http://github.com/wendellpiez.> github.com/wendellpiez...
...gitlab.coko.foundation/wendell... 

Received on Friday, 7 March 2025 19:46:35 UTC