@OpenApiAll public class DOCXFormatter extends DefaultFormatter
dpi, properties, styledDocument
DOT_PER_INCH
Constructor and Description |
---|
DOCXFormatter(ITemplateEngine templateEngine)
Create a Docx formatter with specific properties.
|
DOCXFormatter(java.util.Properties properties)
Create a Docx formatter with specific properties.
|
Modifier and Type | Method and Description |
---|---|
protected float[] |
adjustImage(Image image,
float w,
float h,
int flag)
Returns [imageWidth, imageHeight, imageRotate, effectL, effectT, effectR, effectB ] the image will be
rotated if necessary 914,400 EMU per inch 12,700 EMU in a point360,000 EMU per cm.
|
protected ITool.RetainedString |
createBookmark(Bookmark bookmark)
Create a DOCX bookmark string from given
Bookmark object. |
protected ITool.RetainedString |
createGridRowSpan(GridRowSpan span)
Create a DOCX gridrowspan (merge columns vertically) string from given
GridRowSpan object. |
protected ITool.RetainedString |
createGridSpan(GridSpan span)
Create a DOCX gridspan (merge columns horizontally) string from given
GridSpan object. |
protected ITool.RetainedString |
createImage(Image image)
Create a DOCX image string from given
Image object. |
protected ITool.RetainedString |
createImage(Image image,
float width,
float height,
int flag)
Create a DOCX image string from given
Image object. |
protected ITool.RetainedString |
createLink(Link link)
Create a DOCX 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 double |
getPaperHeight() |
protected double |
getPaperWidth() |
protected double |
getPropertyPageHeight() |
protected double |
getPropertyPageWidth() |
getImageFlag, getObjectFormater, getProperties, registerObjectFormatter, setProperties, setStyledDocument, writeImage, writeImage
public DOCXFormatter(ITemplateEngine templateEngine)
templateEngine
- template enginepublic DOCXFormatter(java.util.Properties properties)
properties
- template propertiespublic 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, float width, float 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 occurspublic float[] getPageSize()
protected float[] adjustImage(Image image, float w, float h, int flag)
image
- image objectw
- image widthh
- image heightflag
- scaling image flagprotected 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 occursprotected ITool.RetainedString createGridSpan(GridSpan span)
GridSpan
object.span
- an GridSpan
objectprotected ITool.RetainedString createGridRowSpan(GridRowSpan span)
GridRowSpan
object.span
- an GridRowSpan
objectprotected double getPaperWidth()
protected double getPropertyPageWidth()
protected double getPaperHeight()
protected double getPropertyPageHeight()
Copyright © 2010 - No Magic Asia