public class Canvas extends Paragraph implements com.aspose.ms.System.ICloneable
Represents a Canvs Paragraph
in a Pdf document.
[C#] Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(0; Aspose.Pdf.Generator.Section sec = new Aspose.Pdf.Generator.Section(); pdf.Sections.Add(sec); Aspose.Pdf.Generator.Canvas canvas = new Aspose.Pdf.Generator.Canvas(); canvas.FillColor = new Aspose.Pdf.Generator.Color(0, 128, 128); sec.Paragraphs.Add(canvas); Aspose.Pdf.Generator.FloatingBox fb1 = new Aspose.Pdf.Generator.FloatingBox(); fb1.Left = 250F; fb1.Top = 150F; fb1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("This is a text in floating box.")); canvas.Paragraphs.Add(fb1); Aspose.Pdf.Generator.FloatingBox fb2 = new Aspose.Pdf.Generator.FloatingBox(); fb2.Left = 50F; fb2.Top = 100F; Aspose.Pdf.Generator.Image image2 = new Aspose.Pdf.Generator.Image(); image2.ImageInfo.File = "temp.jpeg"; image2.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg; fb2.Paragraphs.Add(image2); canvas.Paragraphs.Add(fb2); pdf.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() pdf1.Sections.Add(sec1) Dim canvas As Canvas = New Canvas() canvas.FillColor = new Aspose.Pdf.Generator.Color(0, 128, 128) sec1.Paragraphs.Add(canvas) Dim fb1 As FloatingBox = New FloatingBox() fb1.Left = 250F fb1.Top = 150F fb1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("This is a text in floating box.")) canvas.Paragraphs.Add(fb1) Dim fb2 As FloatingBox = New FloatingBox() fb2.Left = 50F fb2.Top = 100F Dim image2 = New Image() image2.ImageInfo.File = "temp.jpeg" image2.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg; fb2.Paragraphs.Add(image2) canvas.Paragraphs.Add(fb2) pdf1.Save(...) [XML] <Pdf xmlns="Aspose.Pdf"> <Section> <Canvas Width="450" Height="440"> <Border> <Box LineWidth="0.5"> </Box> </Border> <FloatingBox Left="250" Top="150"> <Text> <Segment>This is a text in floating box. </Segment> </Text> </FloatingBox> <FloatingBox Left="50" Top="100"> <Image File="F:/temp/temp.002.jpeg" Type="Jpeg"> </Image> </FloatingBox> </Canvas> <Text> <Segment>ADFASFDASDF </Segment> </Text> </Section> </Pdf>
Paragraph.VerticalPositionInfo
Modifier and Type | Field and Description |
---|---|
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 |
---|
Canvas()
Initializes a new instance of the
Canvas class with default width(available page width) and height(279F). |
Canvas(float width,
float height)
Initializes a new instance of the
Canvas class with specified width and height. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone() |
Object |
deepClone()
Clones a new
Canvas object. |
BorderInfo |
getBorder()
Gets or sets a
BorderInfo object that indicates the border info of the canvas. |
float |
getBoxHeight()
Gets or sets a float value that indicates the height of the canvas.
|
float |
getBoxWidth()
Gets or sets a float value that indicates the width of the canvas.
|
Color |
getFillColor()
Gets or sets a
Aspose.Pdf.Color object that indicates the background color of the
canvas. |
Paragraphs |
getParagraphs()
Gets or sets a
GraphInfo collection that indicates all paragraphs in the section. |
void |
setBorder(BorderInfo value) |
void |
setBoxHeight(float value) |
void |
setBoxWidth(float value) |
void |
setFillColor(Color value) |
void |
setParagraphs(Paragraphs 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 Canvas(float width, float height)
Initializes a new instance of the Canvas
class with specified width and height.
width
- The width of the Canvas.height
- The height of the Canvas.public Canvas()
Initializes a new instance of the Canvas
class with default width(available page width) and height(279F).
public float getBoxWidth()
Gets or sets a float value that indicates the width of the canvas.
public void setBoxWidth(float value)
public float getBoxHeight()
Gets or sets a float value that indicates the height of the canvas.
public void setBoxHeight(float value)
public BorderInfo getBorder()
Gets or sets a BorderInfo
object that indicates the border info of the canvas.
public void setBorder(BorderInfo value)
public Color getFillColor()
Gets or sets a Aspose.Pdf.Color
object that indicates the background color of the
canvas.
public void setFillColor(Color value)
public Paragraphs getParagraphs()
Gets or sets a GraphInfo
collection that indicates all paragraphs in the section.
public void setParagraphs(Paragraphs value)
public Object completeClone()
completeClone
in class Paragraph
public Object deepClone()
Clones a new Canvas
object. Paragraphs in the canvas are not cloned.
deepClone
in interface com.aspose.ms.System.ICloneable
Canvas
object.Copyright © 2016 Aspose. All Rights Reserved.