RASTERIZER(1)

πŸ‘‘ RASTERIZER(1) β€” User Commands, bestie edition

okay so you opened the manual page for rasterizer β€” section 1, User Commands, the real ones β€” and honestly? it's giving "tiny command, huge energy" because this little thing converts your SVG files into basically everything you'd ever want. πŸ’… Let's get into it, no cap.


✨ NAME ✨

rasterizer β€” SVG conversion πŸ¦‹


✨ SYNOPSIS ✨

rasterizer [options] files

that's it. that's the whole vibe. options, then files, go. 🌸


✨ DESCRIPTION ✨

So Rasterizer is a program that takes your SVG files and converts them into various formats, namely PNG, JPEG and PDF. That's the whole job and it does it beautifully. πŸŽ€


✨ OPTIONS ✨

Okay bestie, quick heads-up before we dive in: this manpage literally lists the options twice. Not me making that up β€” it's right there in the source. So we're doing round one, then round two, and round two has a couple of extra little details. Read both, iykyk. 🫢

Round one 🌈

  • -d <dir|file> β€” output directory. and if you've only got a single input file? then this can be a file instead. slay.
  • -m <mimeType> β€” output mime type. should be one of image/jpg, image/jpeg, image/jpe, image/png, image/tiff or application/pdf.
  • -w <width> β€” output width. it's a floating point value, so yes you can be precise about it. ✨
  • -h <height> β€” output height. also a floating point value.
  • -maxw <width> β€” Maximum output width. floating point value, again.
  • -maxh <height> β€” Maximum output height. floating point value, again again.
  • -a <area> β€” output area. the format for area is x,y,w,h, where x, y, w and h are all floating point values.
  • -bg <color> β€” output color. the format for color is a.r.g.b, where a, r, g and b are integer values.
  • -cssMedia <media> β€” CSS media type for which the source SVG files should be converted.
  • -cssAlternate <alternate> β€” CSS alternate stylesheet to use when converting the source SVG files.
  • -cssUser <userStylesheet> β€” CSS user stylesheet URI to apply to converted SVG documents, on top of any other referenced or embedded stylesheets.
  • -font-family <defaultFontFamily> β€” the value used as a default when no font-family value is specified.
  • -lang <userLanguage> β€” User language to use when converting SVG documents.
  • -q <quality> β€” Quality for the output image. this one is only relevant for the image/jpeg mime type, so don't come crying to it about your PNGs. πŸ’€
  • -indexed (1|2|4|8) β€” Reduces the image to the given number of bits per pixel using an adaptive palette, resulting in an Indexed image. currently only supported for PNG conversion. 🎨
  • -dpi <resolution> β€” Resolution for the output image.
  • -validate β€” Controls whether the source SVG files should be validated.
  • -onload β€” Controls if the source SVG files must be rasterized after dispatching the 'onload' event.
  • -scriptSecurityOff β€” removes any security check on the scripts running as a result of dispatching the onload event.
  • -anyScriptOrigin β€” controls whether scripts can be loaded from any location. By default, scripts can only be loaded from the same location as the document referencing them.
  • -scripts <listOfAllowedScripts> β€” List of script types (i.e., values for the type attribute in the <script> tag) which should be loaded.

Round two πŸ¦‹ (yes, for real, it's listed again)

  • -d <dir|file> β€” output directory. If there is a single input file, this can be a file.
  • -m <mimeType> β€” output mime type.
  • -w <width> β€” output width. This is a floating point value.
  • -h <height> β€” output height. This is a floating point value.
  • -maxw <width> β€” Maximum output width. This is a floating point value.
  • -maxh <height> β€” Maximum output height. This is a floating point value.
  • -a <area> β€” output area. The format for area is x,y,w,h, where x, y, w and h are floating point values.
  • -bg <color> β€” output color. The format for color is a.r.g.b, where a, r, g and b are integer values.
  • -cssMedia <media> β€” CSS media type for which the source SVG files should be converted.
  • -cssAlternate <alternate> β€” CSS alternate stylesheet to use when converting the source SVG files.
  • -cssUser <userStylesheet> β€” CSS user stylesheet URI to apply to converted SVG documents in addition to any other referenced or embedded stylesheets.
  • -font-family <defaultFontFamily> β€” Value used as a default when no font-family value is specified.
  • -lang <userLanguage> β€” User language to use when converting SVG documents.
  • -q <quality> β€” Quality for the output image. This is only relevant for the image/jpeg mime type.
  • -indexed (1|2|4|8) β€” Reduces the image to given number of bits per pixel using an adaptive palette, resulting in an Indexed image. This is currently only supported for PNG conversion.
  • -dpi <resolution> β€” Resolution for the output image.
  • -validate β€” Controls whether the source SVG files should be validated.
  • -onload β€” Controls if the source SVG files must be rasterize after dispatching the 'onload' event.
  • -scriptSecurityOff β€” removes any security check on the scripts running as a result of dispatching the onload event. Always enabled, as in most cases, rasterizer just fails to run without this option. See -scriptSecurityOn. 😭
  • -scriptSecurityOn β€” If this is the first argument on the command-line, turn security back on. You'll most likely be hit by the possible bug mentioned below. πŸ’€
  • -anyScriptOrigin β€” controls whether scripts can be loaded from any location. By default, scripts can only be loaded from the same location as the document referencing them.
  • -scripts <listOfAllowedScripts> β€” List of script types (i.e., values for the type attribute in the <script> tag) which should be loaded.

πŸ’€ BUGS πŸ’€

okay so if rasterizer fails with an error in the spirit of:

Exception in thread "main" java.security.AccessControlException: access
denied (java.util.PropertyPermission java.security.policy write)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
        at
java.security.AccessController.checkPermission(AccessController.java:546)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at
java.lang.System.setProperty(System.java:727)

then bestie, run it with the -scriptSecurityOff option on. 🫢 It seems in some cases the security design is slightly too strong. This might become the default some day. (not a promise, just what the page says, don't @ me)


🧚 JAVA-WRAPPERS NOTE 🧚

This program is a shell script wrapper based on java-wrappers(7). So you benefit from several features β€” please see the java-wrappers(7) manual page for more information about them. ✨


🌸 AUTHORS 🌸

rasterizer is part of batik, written by the Apache Software Foundation.

This manual page was written by Vincent Fourmond <fourmond@debian.org> for the Debian Project, but may be used by others. iconic behavior tbh. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie πŸŽ€ β€” SVG conversion, brought to you by the January 2008 edition of this fine manual. go forth and rasterize responsibly. πŸ’–