@Component @Named(value="svg") @Singleton public class SVGScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
SVGScriptService() |
Modifier and Type | Method and Description |
---|---|
boolean |
rasterizeToResponse(String content)
Rasterize an image as PNG into the current response.
|
boolean |
rasterizeToResponse(String content,
int width,
int height)
Rasterize an image as PNG into the current response.
|
ExtendedURL |
rasterizeToTemporaryResource(String content)
Rasterize an image as PNG into a temporary resource belonging to the current document, accessible through the
"tmp" resource URL handler.
|
ExtendedURL |
rasterizeToTemporaryResource(String content,
DocumentReference targetContext)
Rasterize an image as PNG into a temporary resource belonging to the current document, accessible through the
"tmp" resource URL handler.
|
ExtendedURL |
rasterizeToTemporaryResource(String content,
int width,
int height)
Rasterize an image as PNG into a temporary resource belonging to the current document, accessible through the
"tmp" resource URL handler.
|
ExtendedURL |
rasterizeToTemporaryResource(String content,
int width,
int height,
DocumentReference targetContext)
Rasterize an image as PNG as into temporary resource belonging to the current document, accessible through the
"tmp" resource URL handler.
|
public ExtendedURL rasterizeToTemporaryResource(String content)
content
- the SVG imagepublic ExtendedURL rasterizeToTemporaryResource(String content, int width, int height)
content
- the SVG imagewidth
- the desired width of the raster image, in pixels; if 0 or a negative number, the image's native size
is usedheight
- the desired height of the raster image, in pixels; if 0 or a negative number, the image's native
size is usedpublic ExtendedURL rasterizeToTemporaryResource(String content, DocumentReference targetContext)
content
- the SVG imagetargetContext
- the document which will "own" the new temporary resourcepublic ExtendedURL rasterizeToTemporaryResource(String content, int width, int height, DocumentReference targetContext)
content
- the SVG imagewidth
- the desired width of the raster image, in pixels; if 0 or a negative number, the image's native size
is usedheight
- the desired height of the raster image, in pixels; if 0 or a negative number, the image's native
size is usedtargetContext
- the document which will "own" the new temporary resourcepublic boolean rasterizeToResponse(String content)
content
- the SVG imagetrue
if the image was successfully rasterized and written to the response, false
in case
of exceptionspublic boolean rasterizeToResponse(String content, int width, int height)
content
- the SVG imagewidth
- the desired width of the raster image, in pixels; if 0 or a negative number, the image's native size
is usedheight
- the desired height of the raster image, in pixels; if 0 or a negative number, the image's native
size is usedtrue
if the image was successfully rasterized and written to the response, false
in case
of exceptionsCopyright © 2004–2022 XWiki. All rights reserved.