|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.rtf.RtfElement
com.lowagie.text.rtf.document.RtfPageSetting
public class RtfPageSetting
The RtfPageSetting stores the page size / page margins for a RtfDocument. INTERNAL CLASS - NOT TO BE USED DIRECTLY
Field Summary | |
---|---|
private boolean |
landscape
Whether the page is portrait or landscape |
private static byte[] |
LANDSCAPE
Constant for landscape |
private static byte[] |
MARGIN_BOTTOM
Constant for the bottom margin |
private static byte[] |
MARGIN_LEFT
Constant for the left margin |
private static byte[] |
MARGIN_RIGHT
Constant for the right margin |
private static byte[] |
MARGIN_TOP
Constant for the top margin |
private int |
marginBottom
The bottom margin to use |
private int |
marginLeft
The left margin to use |
private int |
marginRight
The right margin to use |
private int |
marginTop
The top margin to use |
private static byte[] |
PAGE_HEIGHT
Constant for the page width |
private static byte[] |
PAGE_WIDTH
Constant for the page height |
private int |
pageHeight
The page height to use |
private int |
pageWidth
The page width to use |
private static byte[] |
SECTION_MARGIN_BOTTOM
Constant for the section bottom margin |
private static byte[] |
SECTION_MARGIN_LEFT
Constant for the section left margin |
private static byte[] |
SECTION_MARGIN_RIGHT
Constant for the section right margin |
private static byte[] |
SECTION_MARGIN_TOP
Constant for the section top margin |
private static byte[] |
SECTION_PAGE_HEIGHT
Constant for the section page height |
private static byte[] |
SECTION_PAGE_WIDTH
Constant for the section page width |
Fields inherited from class com.lowagie.text.rtf.RtfElement |
---|
document, inHeader, inTable |
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement |
---|
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR |
Constructor Summary | |
---|---|
RtfPageSetting(RtfDocument doc)
Constructs a new RtfPageSetting object belonging to a RtfDocument. |
Method Summary | |
---|---|
int |
getMarginBottom()
Gets the bottom margin |
int |
getMarginLeft()
Gets the left margin |
int |
getMarginRight()
Gets the right margin |
int |
getMarginTop()
Gets the top margin |
int |
getPageHeight()
Gets the page height |
int |
getPageWidth()
Gets the page width |
private boolean |
guessFormat(Rectangle pageSize,
boolean rotate)
This method tries to fit the Rectangle pageSize to one of the predefined PageSize rectangles. |
private boolean |
rectEquals(Rectangle rect1,
Rectangle rect2)
This method compares to Rectangles. |
void |
setMarginBottom(int marginBottom)
Sets the bottom margin |
void |
setMarginLeft(int marginLeft)
Sets the left margin to use |
void |
setMarginRight(int marginRight)
Sets the right margin to use |
void |
setMarginTop(int marginTop)
Sets the top margin to use |
void |
setPageHeight(int pageHeight)
Sets the page height to use |
void |
setPageSize(Rectangle pageSize)
Set the page size to use. |
void |
setPageWidth(int pageWidth)
Sets the page width to use |
void |
writeContent(OutputStream out)
unused |
void |
writeDefinition(OutputStream result)
Writes the page size / page margin definition |
void |
writeSectionDefinition(OutputStream result)
Writes the definition part for a new section |
Methods inherited from class com.lowagie.text.rtf.RtfElement |
---|
intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.lowagie.text.rtf.RtfBasicElement |
---|
setInHeader, setInTable, setRtfDocument |
Field Detail |
---|
private static final byte[] PAGE_WIDTH
private static final byte[] PAGE_HEIGHT
private static final byte[] MARGIN_LEFT
private static final byte[] MARGIN_RIGHT
private static final byte[] MARGIN_TOP
private static final byte[] MARGIN_BOTTOM
private static final byte[] LANDSCAPE
private static final byte[] SECTION_PAGE_WIDTH
private static final byte[] SECTION_PAGE_HEIGHT
private static final byte[] SECTION_MARGIN_LEFT
private static final byte[] SECTION_MARGIN_RIGHT
private static final byte[] SECTION_MARGIN_TOP
private static final byte[] SECTION_MARGIN_BOTTOM
private int pageWidth
private int pageHeight
private int marginLeft
private int marginRight
private int marginTop
private int marginBottom
private boolean landscape
Constructor Detail |
---|
public RtfPageSetting(RtfDocument doc)
doc
- The RtfDocument this RtfPageSetting belongs toMethod Detail |
---|
public void writeContent(OutputStream out) throws IOException
writeContent
in interface RtfBasicElement
writeContent
in class RtfElement
out
- The OutputStream
to write the content to
IOException
public void writeDefinition(OutputStream result) throws IOException
writeDefinition
in interface RtfExtendedElement
result
- The OutputStream
to write the element definition to
IOException
public void writeSectionDefinition(OutputStream result) throws IOException
IOException
public int getMarginBottom()
public void setMarginBottom(int marginBottom)
marginBottom
- The bottom margin to usepublic int getMarginLeft()
public void setMarginLeft(int marginLeft)
marginLeft
- The left margin to usepublic int getMarginRight()
public void setMarginRight(int marginRight)
marginRight
- The right margin to usepublic int getMarginTop()
public void setMarginTop(int marginTop)
marginTop
- The top margin to usepublic int getPageHeight()
public void setPageHeight(int pageHeight)
pageHeight
- The page height to usepublic int getPageWidth()
public void setPageWidth(int pageWidth)
pageWidth
- The page width to usepublic void setPageSize(Rectangle pageSize)
pageSize
- The pageSize to useprivate boolean guessFormat(Rectangle pageSize, boolean rotate)
Rectangle pageSize
to one of the predefined PageSize rectangles.
If a match is found the pageWidth and pageHeight will be set according to values determined from files
generated by MS Word2000 and OpenOffice 641. If no match is found the method will try to match the rotated
Rectangle by calling itself with the parameter rotate set to true.
pageSize
- the page size for which to guess the correct formatrotate
- Whether we should try to rotate the size befor guessing the format
True
if the format was guessed, false/ otherwise
private boolean rectEquals(Rectangle rect1, Rectangle rect2)
rect1
- The first Rectangle to comparerect2
- The second Rectangle to compare
True
if the Rectangles equal, false
otherwise
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |