public class ODFFormatter extends DefaultFormatter
dpi, properties, styledDocument
DOT_PER_INCH
Constructor and Description |
---|
ODFFormatter(ITemplateEngine templateEngine)
Create a ODF formatter with specific properties.
|
Modifier and Type | Method and Description |
---|---|
protected float[] |
adjustImage(float w,
float h,
int flag,
boolean isRotate)
Returns fitting image size.
|
protected ITool.RetainedString |
createBookmark(Bookmark bookmark)
Create a ODF book mark string from given
Bookmark object. |
protected ITool.RetainedString |
createImage(Image image)
Create a ODF image string from given
Image object. |
protected ITool.RetainedString |
createImage(Image image,
int width,
int height,
int flag)
Create a ODF image string from given
Image object. |
protected ITool.RetainedString |
createLink(Link link)
Create a ODF link string from given
Link object. |
java.lang.Object |
format(java.lang.Object value)
Convert an Object value into HTML format.
|
float[] |
getPageSize()
Calculation for total paper width and total paper height after minus margin of page.
|
protected boolean |
isLargeImage(Image image)
Compare the width and height of the image and paper if the image is larger than paper size, it's considered
as large image.
|
getImageFlag, getObjectFormater, getProperties, registerObjectFormatter, setProperties, setStyledDocument, writeImage, writeImage
public ODFFormatter(ITemplateEngine templateEngine)
templateEngine
- template enginepublic java.lang.Object format(java.lang.Object value)
format
in interface IFormatter
format
in class DefaultFormatter
value
- converting valueprotected ITool.RetainedString createImage(Image image) throws java.io.IOException
Image
object.image
- an Image
objectjava.io.IOException
- when IO error occursprotected ITool.RetainedString createImage(Image image, int width, int height, int flag) throws java.io.IOException
Image
object.image
- an Image
objectwidth
- the target image widthheight
- the target image heightflag
- scaling image flagjava.io.IOException
- when IO error occursprotected float[] adjustImage(float w, float h, int flag, boolean isRotate)
w
- image widthh
- image heightflag
- scaling image flagisRotate
- true to adjust rotated imageprotected boolean isLargeImage(Image image)
image
- image want to compare with paperpublic float[] getPageSize()
protected ITool.RetainedString createBookmark(Bookmark bookmark) throws java.io.IOException
Bookmark
object.bookmark
- an Bookmark
objectjava.io.IOException
- when IO error occursprotected ITool.RetainedString createLink(Link link) throws java.io.IOException
Link
object.link
- an Link
objectjava.io.IOException
- when IO error occursCopyright © 2010 - No Magic Asia