public class FloatingBox extends Paragraph implements com.aspose.ms.System.ICloneable
Represents a FloatingBox Paragraph
in a Pdf document. FloatingBox is custom positioned.
[C#] //Create pdf document Pdf pdf1 = new Pdf(); //Add a section into the pdf document Aspose.Pdf.Generator.Section section1 = pdf1.Sections.Add(); //Create a FloatingBox object FloatingBox FloatingBox1 = new FloatingBox(108, 80); //Add FloatingBox to Paragraphs collection of section object section1.Paragraphs.Add(FloatingBox1); // Specify the box horizontal positioning type to measured distance from the top page margin FloatingBox1.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin; // Set the box Horizonatl positioning alignment as Right aligned FloatingBox1.BoxHorizontalAlignment = BoxHorizontalAlignmentType.Right; // Specify the box Vertical positioning type to measured distance from the top edge of the page FloatingBox1.BoxVerticalPositioning = BoxVerticalPositioningType.Page; // Set the box Vertical positioning alignment as Centered aligned FloatingBox1.BoxVerticalAlignment = BoxVerticalAlignmentType.Center; // add a new text paragraph to paragraphs collection of FloatingBox object FloatingBox1.Paragraphs.Add(new Text("This is a test for floating text box.")); //Save the pdf document pdf1.Save(@"D:\pdftest\FloatingBoxTest_code.pdf"); [Visual Basic] � Create pdf document Dim pdf1 As Pdf = New Pdf() � Add a section into the pdf document Dim section1 As Section = pdf1.Sections.Add() � Create a FloatingBox object Dim FloatingBox1 As FloatingBox = New FloatingBox(108,80) � Add FloatingBox to Paragraphs collection of section object section1.Paragraphs.Add(FloatingBox1) � Specify the box horizontal positioning type to measured distance from the top page margin FloatingBox1.BoxHorizontalPositioning = BoxHorizontalPositioningType.Margin � Set the box Horizonatl positioning alignment as Right aligned FloatingBox1.BoxHorizontalAlignment = BoxHorizontalAlignmentType.Right � Specify the box Vertical positioning type to measured distance from the top edge of the page FloatingBox1.BoxVerticalPositioning = BoxVerticalPositioningType.Page � Set the box Vertical positioning alignment as Centered aligned FloatingBox1.BoxVerticalAlignment = BoxVerticalAlignmentType.Center � add a new text paragraph to paragraphs collection of FloatingBox object FloatingBox1.Paragraphs.Add(New Text("This is a test for floating text box.")) � Save the pdf document pdf1.Save("d:/test/test.pdf") [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <FloatingBox Width="1.5inch" Height="80" BoxHorizontalPositioning="Margin" BoxHorizontalAlignment="Right" BoxVerticalPositioning="Page" BoxVerticalAlignment="Center"> <Text><Segment>This is a test floating text box.</Segment></Text> </FloatingBox> </Section> </Pdf>
Paragraph.VerticalPositionInfo
Modifier and Type | Field and Description |
---|---|
boolean |
IsInCanvas |
boolean |
IsWidthSet |
absolutePosX, absolutePosY, ClippingArea, FixedHeight, FixedWidth, isAbsoluteLayout, isFixedLayout, IsNeedAddToPage, IsPositionGot, IsPositionProcessed, isRelativeLayout, MayNeedReprocess, NextParagraph, posBottom, posLeft, posRight, posTop, RefPara, relativePosX, relativePosY, VerticalPosInfo
Constructor and Description |
---|
FloatingBox() |
FloatingBox(float width,
float height)
Initializes a new instance of the
FloatingBox class with specified width and height. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone()
Clones a new
FloatingBox object. |
Object |
deepClone()
Clones a new
FloatingBox object. |
Color |
getBackgroundColor()
Gets or sets a
Aspose.Pdf.Color object that indicates the background color of the
floating box. |
BorderInfo |
getBorder()
Gets or sets a
BorderInfo object that indicates the border info of the floating box. |
float |
getBoxHeight()
Gets or sets a float value that indicates the height of the floating box.
|
int |
getBoxHorizontalAlignment()
Gets or sets a
BoxHorizontalAlignmentType object that indicates the horizontal
alignment type of the floating box. |
int |
getBoxHorizontalPositioning()
Gets or sets a
BoxHorizontalPositioningType object that indicates the horizontal
positioning type of the floating box. |
int |
getBoxVerticalAlignment()
Gets or sets a
BoxVerticalAlignmentType object that indicates the vertical
alignment type of the floating box. |
int |
getBoxVerticalPositioning()
Gets or sets a
BoxVerticalPositioningType object that indicates the vertical
positioning type of the floating box. |
float |
getBoxWidth()
Gets or sets a float value that indicates the width of the floating box.
|
MarginInfo |
getPadding()
Gets or sets a
MarginInfo object that indicates the padding of the floating box. |
Paragraphs |
getParagraphs()
Gets or sets a
Paragraphs collection that indicates all paragraphs in the cell. |
int |
getTextVerticalAlignment()
Gets or sets a
VerticalAlignmentType enum that indicates the vertical alignment
type of all paragraphs in the floating box. |
int |
getVerticalTextRotationAngle()
Gets or sets a
VerticalTextRotationType object that indicates the text rotation
angle in floating box or cells. |
int |
getZIndex()
Gets or sets a int value that indicates the Z-order of the floating box.
|
boolean |
isExtraContentClip()
Gets or sets a value that indicates in case with fixed row height, do content will be truncated if it go out of margin
|
void |
isExtraContentClip(boolean value) |
boolean |
isNeedRepeating()
Gets or sets a bool value that indicates whether the paragraph need to be repeated on next page.
|
void |
isNeedRepeating(boolean value) |
void |
setBackgroundColor(Color value) |
void |
setBorder(BorderInfo value) |
void |
setBoxHeight(float value) |
void |
setBoxHorizontalAlignment(int value) |
void |
setBoxHorizontalPositioning(int value) |
void |
setBoxVerticalAlignment(int value) |
void |
setBoxVerticalPositioning(int value) |
void |
setBoxWidth(float value) |
void |
setPadding(MarginInfo value) |
void |
setParagraphs(Paragraphs value) |
void |
setTextVerticalAlignment(int value) |
void |
setVerticalTextRotationAngle(int value) |
void |
setZIndex(int value) |
copyTo, getBookmarked, getComposer, getFootNoteProcessed, getHeight, getID, getLeft, getMargin, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferencedParagraphWidth, getReferenceParagraphID, getRefPageNumber, getSection, getTop, getWidth, isDisabled, isDisabled, isEndNote, isFirstParagraph, isFirstParagraph, isFirstParagraphInColumn, isFirstParagraphInColumn, isFootNote, isFootNote, isInHeaderFooter, isInHeaderFooter, isInList, isInList, isKeptTogether, isKeptTogether, isKeptWithNext, isKeptWithNext, isOnOddPage, isOnOddPage, setBookmarked, setFootNoteProcessed, setHeight, setID, setLeft, setMargin, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferencedParagraphWidth, setReferenceParagraphID, setRefPageNumber, setSection, setTop, setWidth
public FloatingBox(float width, float height)
Initializes a new instance of the FloatingBox
class with specified width and height.
width
- The width of the box.height
- The height of the box.public FloatingBox()
public float getBoxWidth()
Gets or sets a float value that indicates the width of the floating box.
public void setBoxWidth(float value)
public float getBoxHeight()
Gets or sets a float value that indicates the height of the floating box.
public void setBoxHeight(float value)
public boolean isNeedRepeating()
Gets or sets a bool value that indicates whether the paragraph need to be repeated on next page. Default value is false.The attribute is only valid when the paragraph itself and the object its ReferenceParagraphID referred to both are included in RepeatingRows.
public void isNeedRepeating(boolean value)
public Paragraphs getParagraphs()
Gets or sets a Paragraphs
collection that indicates all paragraphs in the cell.
public void setParagraphs(Paragraphs value)
public int getBoxHorizontalPositioning()
Gets or sets a BoxHorizontalPositioningType
object that indicates the horizontal
positioning type of the floating box.
public void setBoxHorizontalPositioning(int value)
public int getBoxVerticalPositioning()
Gets or sets a BoxVerticalPositioningType
object that indicates the vertical
positioning type of the floating box.
public void setBoxVerticalPositioning(int value)
public int getBoxHorizontalAlignment()
Gets or sets a BoxHorizontalAlignmentType
object that indicates the horizontal
alignment type of the floating box.
public void setBoxHorizontalAlignment(int value)
public int getBoxVerticalAlignment()
Gets or sets a BoxVerticalAlignmentType
object that indicates the vertical
alignment type of the floating box.
public void setBoxVerticalAlignment(int value)
public int getTextVerticalAlignment()
Gets or sets a VerticalAlignmentType
enum that indicates the vertical alignment
type of all paragraphs in the floating box.
public void setTextVerticalAlignment(int value)
public boolean isExtraContentClip()
Gets or sets a value that indicates in case with fixed row height, do content will be truncated if it go out of margin
public void isExtraContentClip(boolean value)
public BorderInfo getBorder()
Gets or sets a BorderInfo
object that indicates the border info of the floating box.
public void setBorder(BorderInfo value)
public Color getBackgroundColor()
Gets or sets a Aspose.Pdf.Color
object that indicates the background color of the
floating box.
public void setBackgroundColor(Color value)
public MarginInfo getPadding()
Gets or sets a MarginInfo
object that indicates the padding of the floating box.
public void setPadding(MarginInfo value)
public int getVerticalTextRotationAngle()
Gets or sets a VerticalTextRotationType
object that indicates the text rotation
angle in floating box or cells.
public void setVerticalTextRotationAngle(int value)
public int getZIndex()
Gets or sets a int value that indicates the Z-order of the floating box. A floating box with larger ZIndex will be placed over the floating box with smaller ZIndex. ZIndex can be negative. Floating box with negative ZIndex will be placed behind the text in the page.
public void setZIndex(int value)
public Object deepClone()
Clones a new FloatingBox
object. Paragraphs in the floating box are not cloned.
deepClone
in interface com.aspose.ms.System.ICloneable
FloatingBox
object.public Object completeClone()
Clones a new FloatingBox
object. All members in the FloatingBox are cloned.
completeClone
in class Paragraph
FloatingBox
object.Copyright © 2016 Aspose. All Rights Reserved.