createCanvas (workspaceOrImage : nodeset, [fontQuality : string]) : nodeset

This method creates a canvas making drawing into a picture possible. A picture or a workspace must be transferred to the parameter “workspaceOrImage”. These are created with “createImage” and “createWorkspace” of the imageservice core functions.

The parameter “fontQuality” can be specified as an option. If the parameter is not transferred, then the value “Antialiased” is set. Possible values can be seen in the following list.

  • Default
  • Draft
  • Proof
  • Antialiased
  • ClearType

The following example shows the creation of a canvas when transferring a workspace:

<xsl:variable name="workspace" select="is:createWorkspace(@src, true())" />
<xsl:variable name="canvas" select="iscan:createCanvas($workspace)" />

The use of the method is shown in the following source code example.

<xsl:stylesheet xmlns:xsl="" xmlns:ise="" xmlns:iscan="" xmlns:is="" xmlns:b="" xmlns:onion="" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:template match="/recordcard">
<xsl:variable name="workspace" select="is:createWorkspace(picture, true())" />
<xsl:variable name="drawText" select="iscan:drawText(iscan:createCanvas($workspace),'Beispieltext', is:createPoint(0,0),is:createFont('Arial',10,'Bold'), is:createSolidFill(127,255,255,255))" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, ise:createJpegEncoder(80))" />
<b:output mimeType="{picture/@onion:mimeType}">
<b:webResponse expires="60" />
Inserting text

In the example, the text "sample text" is written in text size 10 and bold character font Arial into an existing picture at the position (0,0).