[image]

Include an image in the document loaded from a URL source - for example from a web server of file system.

Parameters

Parameter

Description

url

Required, a text value specifying the URL of the image to be embedded in the document.
Urls can follow the http, https or data schemes.

width / w

Optional parameter, specified the output width of the image.
May be specified in printer dots, mm or as a percentage of the printable width.

min-width

Optional parameter, minimum allowed width for the image.
May be specified in printer dots, mm or as a percentage of the printable width.

Image Scaling

Images may be resized for output based on the values of the width and min-width properties, as well as the printable area of the printer, and pixel size of the source image.

  • If width/min-width are not specified, then the standard behavior to not apply any resizing to the image, instead it will be printed dot-for-dot on the output device, matching pixels to printer dots.
    Exceptions to this rule can occur if:
    • The image pixel width exceeds the available print width, and the markup rendered has been instructed to scale output documents to fit the page.
      In this case, the image well be resized as if the width parameter was set to “100%”.
    • The output printer printing resolution does not provide a 1/1 (square pixel) aspect ratio. In this case, the image will match the output device resolution horizontally, but will be scaled vertically to preserve aspect.

  • If a width (or shorthand w ) parameter is provided, then the image will always be resized to the requested width.
  • if a min-width parameter is provided, then the image will be resized according to the above rules, unless the resulting image would be below the requested minimum size.
    In this case, the image width will be set according to the min-width value.

Note

Image resizing will always preserve the aspect ratio of the source image, which is why only horizontal scaling parameters are provided.

Color/Grey-scale Output

Dithering will be performed to reduce colors/gray levels to match the output device.
f it is desired to avoid dithering then it is recommended to use a monochrome source image.
However, it is not recommended to pre-dither images unless care is also taken to ensure that the images will not resized (set the width property to match the pixel width of the source image) since resizing an already dithered image will usually conflict with the dither pattern.

Recommended Sizing Pattern

In order to get expected output from the full range of output devices -including high resolution thermal printers with support for paper widths from 58mm (2”) to 112mm (4”) and lower resolution dot-matrix printers, with half-dot pixel support- it is recommended to use the following pattern where possible:

  • Specify the width parameter as a percentage value.
    This will then be calculated at print time as a percentage of the printable width available to the printer, and will resize automatically to fit the page.
  • If the width is specified as something other than 100%, the set the min-width property to a millimeter based size, choosing the size that provides the best results on the narrowest supported printer (usually a 58mm/2” model).
    In most cases Star would recommend setting this to 48mm, which is the default printable area on 58mm paper.
For example:
[image: url https://www.star-emea.com/logo.png; width 60%; min-width 48mm]

Line Feed

After printing an image, the print position will move automatically to the next line below the image.
Therefore, it may be preferable to put a \ character immediately after an image command (if it is on a single line of the input data) to escape a subsequent line feed and avoid double spacing.
For example:
[image: url http://site.com/image.png]This is the next Line
is equivalent to:
[image: url http://site.com/image.png]\
This is the next Line
but, the following would cause a line feed between the image and text line.
[image: url http://site.com/image.png]
This is the next Line

Embedding Image Data

It is possible from version 1.1.0 to embed image data directly into the markup file by using the DataURL scheme .
Data URLs can contain any base64 encoded image that is supported by the markup renderer, such as image/jpeg or image/png.
For example:
[image: url "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAjCAIAAADt3TjXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxMAAAsTAQCanBgAAA0GSURBVGhD7ZoJXM/3H8e7DyWpdBBSk9jjH0lbNMe08nct0jFUmDDib/wxozRmjszRHF2G0kjJ5s7i79gsOeb821zlvnObs/k/f7/Pt0+/Di2Lx47H//X4PHh/3p/j+/m8P+/zh/azZ8+0qoaLFy+dO3dO0C4ujczMzA4cOPD48RO6xsZGrq6uYujvAIRVRXz22VQtLT3R1q/f8PDhQxubOqLr5NRImfRXxq+//ioIHUVmVYCOTvEmurq6WlrauroKR08Pkf218fjx47i4BEG/BGGVB23l77840Kbhw0fs3btXdF+RsP4mSEr6skmTxmpzUeH/wnouvvvu+yNHjoSE9Ea/BOcVCauqEfYPx6lTebNmzZ40aeLHH48PCgoUzD+XzyosLLx7925BQcHVq1cLCm5Aw1HGqgwU5N69e+fPn8/NzX306JHCLQ/379+Pipowc+aMFStWODk5+vi8I/jlRCvOd+XKlSNH/nvz5s2Kr21paeHt3V7plICiWXfu3ElOThG0QNu2bRwcHJROEYjNJ06czMhYmZW16fjxE7dv34aDpyBla9zYxdf3neDgICcnJ23tcg7z9OnTb7/NFpevX79+8+ZuP/yQc+7ceboE5R49/FmF0NetW5+evjInZ9e1a9dMTU2PHz9qY2O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Wb1cn6X8Lxp0iuTgzp27QoLlAhdz/vwFDieWgKio8ZMmfQJx48bNpk3dGBV8bJAEvUEDBzIDintNtzN+/Nh27dpBEOYGDRqSkrJU7gZMTU3d3Jq5uv6DKIaxnzqVt3r1qg4dOlGUMMqehw/vR8EbNnQRRhAQ4L9o0cJGjZpQDNMdODA8ISGud+8wShm65uY1rl+/UpkfoCsLlcTU0bBWLTJd1YNUsnEHzd9ed+/eI/+VpYKWnp6hLHj2DOlPnjxFln5lG9GQWPOimiV/Vn6F0bDywI9ERAzJzMwwMjJSWFpaOP7c3J2keRW49lIgFJDNsapDB9/Kr/pNyGjz0sELqMAHSEFlTVsuuE61aiZ49O7du2FiZa9Xr1699evXkIWtXbuOzFZGTE3Y26MFxWAT4sPGjetw6qmpX2VlbcrLy+cNi0ZVE7y921PN0jU0NOAApCaBgT0KC1W/3/NCSJyTExDourur8nUvLy+WQhgbG73ENwAv4X/+vURgNVjZrVs3nz4txNmZm5s7OjoqY384tLT+ByMSArlipQ8SAAAAAElFTkSuQmCC"]

[cut]

Using a local file as an image source

It is possible to embed image data directly into markup from an image stored on the server side.
For example:
[image: url "file:\\\c:Users\\Star\\Pictures\\image.png"]

Example

Markup

This is a simple markup example, demonstrating a middle aligned image with scaling to fit the page.

[align: centre]\
[image: url https://star-emea.com/wp-content/uploads/2015/01/logo.jpg; width 80%; min-width 48mm]\

Image Printing Example

[cut: feed; partial]

Output at 58mm

This is the result when using the markup processor to sent to an mC-Print2 58mm(2inch) printer.

../../_images/image_58mm.jpg

Output at 80mm

This is the result when using the markup processor to sent to a TSP650II 80mm(3inch) printer.

../../_images/image_80mm.jpg