/** * Constructs a RtfAnnotation based on an Annotation. * * @param doc The RtfDocument this RtfAnnotation belongs to * @param annotation The Annotation this RtfAnnotation is based off */ public RtfAnnotation(RtfDocument doc, Annotation annotation) : base(doc) { title = annotation.Title; content = annotation.Content; }
/** * Constructs a new RtfWriter that listens to the specified Document and * writes its output to the Stream. * * @param doc The Document that this RtfWriter listens to * @param os The Stream to write to */ protected RtfWriter2(Legacy.Text.Document doc, Stream os) : base(doc, os) { doc.AddDocListener(this); rtfDoc = new RtfDocument(); }
/** * Constructs a new RtfDocumentSettings object. * * @param document The RtfDocument this RtfDocumentSettings belong to. */ public RtfDocumentSettings(RtfDocument document) { this.document = document; }
public override void SetParser(RtfParser parser) { this.rtfParser = parser; this.rtfDoc = parser.GetRtfDocument(); this.doc = parser.GetDocument(); this.conversionType = parser.GetConversionType(); SetToDefaults(); if (this.rtfParser.IsConvert()) { this.rtfParser.GetState().properties.AddRtfPropertyListener(this); } }
/** * Constructs a RtfMapper for a RtfDocument * * @param doc The RtfDocument this RtfMapper belongs to */ public RtfMapper(RtfDocument doc) { this.rtfDoc = doc; }
/** * Constructs a <code>RtfGenerator</code> belonging to a RtfDocument * * @param doc The <code>RtfDocument</code> this <code>RtfGenerator</code> belongs to */ public RtfGenerator(RtfDocument doc) : base(doc) { }
/** * Constructs a new RtfPageSetting object belonging to a RtfDocument. * * @param doc The RtfDocument this RtfPageSetting belongs to */ public RtfPageSetting(RtfDocument doc) : base(doc) { }
/** * Constructs a RtfHeaderGroup for a certain HeaderFooter * * @param doc The RtfDocument this RtfHeaderFooter belongs to * @param headerFooter The HeaderFooter to display * @param type The typ of RtfHeaderFooterGroup to create */ public RtfHeaderFooterGroup(RtfDocument doc, Legacy.Text.HeaderFooter headerFooter, int type) : base(new Phrase(""), false) { this.document = doc; this.type = type; this.mode = MODE_SINGLE; headerAll = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES); headerAll.SetType(this.type); }
/** * Sets the RtfDocument this RtfElement belongs to * * @param doc The RtfDocument to use */ public void SetRtfDocument(RtfDocument doc) { this.document = doc; if (headerAll != null) { headerAll.SetRtfDocument(this.document); } if (headerFirst != null) { headerFirst.SetRtfDocument(this.document); } if (headerLeft != null) { headerLeft.SetRtfDocument(this.document); } if (headerRight != null) { headerRight.SetRtfDocument(this.document); } }
/** * Constructs a RtfAnchor based on a RtfField * * @param doc The RtfDocument this RtfAnchor belongs to * @param anchor The Anchor this RtfAnchor is based on */ public RtfAnchor(RtfDocument doc, Anchor anchor) : base(doc) { this.url = anchor.Reference; this.content = new RtfPhrase(doc, anchor); }
/** * Constructs a RtfHeaderFooterGroup by copying the content of the original * RtfHeaderFooterGroup * * @param doc The RtfDocument this RtfHeaderFooter belongs to * @param headerFooter The RtfHeaderFooterGroup to copy * @param type The type of RtfHeaderFooterGroup to create */ public RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooterGroup headerFooter, int type) : base(new Phrase(""), false) { this.document = doc; this.mode = headerFooter.GetMode(); this.type = type; if (headerFooter.GetHeaderAll() != null) { this.headerAll = new RtfHeaderFooter(this.document, headerFooter.GetHeaderAll(), RtfHeaderFooter.DISPLAY_ALL_PAGES); } if (headerFooter.GetHeaderFirst() != null) { this.headerFirst = new RtfHeaderFooter(this.document, headerFooter.GetHeaderFirst(), RtfHeaderFooter.DISPLAY_FIRST_PAGE); } if (headerFooter.GetHeaderLeft() != null) { this.headerLeft = new RtfHeaderFooter(this.document, headerFooter.GetHeaderLeft(), RtfHeaderFooter.DISPLAY_LEFT_PAGES); } if (headerFooter.GetHeaderRight() != null) { this.headerRight = new RtfHeaderFooter(this.document, headerFooter.GetHeaderRight(), RtfHeaderFooter.DISPLAY_RIGHT_PAGES); } SetType(this.type); }
/** * Constructs a RtfBorderGroup with certain borders * * @param doc The RtfDocument this RtfBorderGroup belongs to * @param borderType The type of borders this RtfBorderGroup contains * @param bordersToUse The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX) * @param borderWidth The border width to use * @param borderColor The border color to use */ protected internal RtfBorderGroup(RtfDocument doc, int borderType, int bordersToUse, float borderWidth, Color borderColor) : base(doc) { this.borderType = borderType; this.borders = new Hashtable(); AddBorder(bordersToUse, RtfBorder.BORDER_SINGLE, borderWidth, borderColor); }
/** * Constructs a <code>RtfProtectionSetting</code> belonging to a RtfDocument * * @param doc The <code>RtfDocument</code> this <code>RtfProtectionSetting</code> belongs to * @since 2.1.1 * @author Howard Shank ([email protected]) */ public RtfProtectionSetting(RtfDocument doc) : base(doc) { }
/** * Constructs a RtfInfoGroup belonging to a RtfDocument * * @param doc The RtfDocument this RtfInfoGroup belongs to */ public RtfInfoGroup(RtfDocument doc) : base(doc) { infoElements = new ArrayList(); }
/** * Constructs a certain type of RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER * and RtfHeaderFooter.TYPE_FOOTER are valid values for type. * * @param doc The RtfDocument this RtfHeaderFooter belongs to * @param type The type of RtfHeaderFooterGroup to create */ public RtfHeaderFooterGroup(RtfDocument doc, int type) : base(new Phrase(""), false) { this.document = doc; this.type = type; }
/** * Constructs a RtfParagraphStyle from another RtfParagraphStyle. * * INTERNAL USE ONLY * * @param doc The RtfDocument this RtfParagraphStyle belongs to. * @param style The RtfParagraphStyle to copy settings from. */ public RtfParagraphStyle(RtfDocument doc, RtfParagraphStyle style) : base(doc, style) { this.document = doc; this.styleName = style.GetStyleName(); this.alignment = style.GetAlignment(); this.firstLineIndent = (int)(style.GetFirstLineIndent() * RtfElement.TWIPS_FACTOR); this.indentLeft = (int) (style.GetIndentLeft() * RtfElement.TWIPS_FACTOR); this.indentRight = (int) (style.GetIndentRight() * RtfElement.TWIPS_FACTOR); this.spacingBefore = (int) (style.GetSpacingBefore() * RtfElement.TWIPS_FACTOR); this.spacingAfter = (int) (style.GetSpacingAfter() * RtfElement.TWIPS_FACTOR); this.lineLeading = (int) (style.GetLineLeading() * RtfElement.TWIPS_FACTOR); this.keepTogether = style.GetKeepTogether(); this.keepTogetherWithNext = style.GetKeepTogetherWithNext(); this.basedOnName = style.basedOnName; this.modified = style.modified; this.styleNumber = style.GetStyleNumber(); if (this.document != null) { SetRtfDocument(this.document); } }
/** * Constructs a RtfDocumentHeader for a RtfDocument * * @param doc The RtfDocument this RtfDocumentHeader belongs to */ protected internal RtfDocumentHeader(RtfDocument doc) : base(doc) { }
/** * Constructs a RtfColor based on the Color * * @param doc The RtfDocument this RtfColor belongs to * @param col The Color to base this RtfColor on */ public RtfColor(RtfDocument doc, Color col) : base(doc) { if (col != null) { this.red = col.R; this.blue = col.B; this.green = col.G; } if (this.document != null) { this.colorNumber = this.document.GetDocumentHeader().GetColorNumber(this); } }
/** * Constructs a new <code>RtfDestinationDocument</code> using * the parameters to initialize the object. * @param rtfDoc The <code>RtfDocument</code> this works with. * @param doc The iText <code>Document</code> this works with. * @param type The type of conversion being done. */ public RtfDestinationDocument(RtfParser parser) : base(parser) { this.rtfDoc = parser.GetRtfDocument(); this.doc = parser.GetDocument(); this.conversionType = parser.GetConversionType(); SetToDefaults(); if (this.rtfParser.IsConvert()) { this.rtfParser.GetState().properties.AddRtfPropertyListener(this); } }
/** * Constructs a RtfColor based on the red/green/blue values * * @param doc The RtfDocument this RtfColor belongs to * @param red The red value to use * @param green The green value to use * @param blue The blue value to use */ public RtfColor(RtfDocument doc, int red, int green, int blue) : base(doc) { this.red = red; this.blue = blue; this.green = green; if (this.document != null) { this.colorNumber = this.document.GetDocumentHeader().GetColorNumber(this); } }
/** * Construct an RtfCodePage * * @param doc The RtfDocument this RtfCodePage belongs to */ public RtfCodePage(RtfDocument doc) : base(doc) { }
/** * Constructor only for use when initializing the RtfColorList * * @param doc The RtfDocument this RtfColor belongs to * @param red The red value to use * @param green The green value to use * @param blue The blue value to use * @param colorNumber The number of the colour in the colour list */ protected internal RtfColor(RtfDocument doc, int red, int green, int blue, int colorNumber) : base(doc) { this.red = red; this.blue = blue; this.green = green; this.colorNumber = colorNumber; }
/** * Closes the RtfDocument. This causes the document to be written * to the specified Stream */ public override void Close() { if (open) { rtfDoc.WriteDocument(os); base.Close(); this.rtfDoc = new RtfDocument(); } }
/** * Sets the RtfDocument this RtfColor belongs to * * @param doc The RtfDocument to use */ public override void SetRtfDocument(RtfDocument doc) { base.SetRtfDocument(doc); if (document != null) { this.colorNumber = document.GetDocumentHeader().GetColorNumber(this); } }
/** * Constructs a RtfNewPage * * @param doc The RtfDocument this RtfNewPage belongs to */ public RtfNewPage(RtfDocument doc) : base(doc) { }
/** * Constructs a RtfRow for a Row. * * @param doc The RtfDocument this RtfRow belongs to * @param rtfTable The RtfTable this RtfRow belongs to * @param row The Row this RtfRow is based on * @param rowNumber The number of this row * @since 2.1.3 */ protected internal RtfRow(RtfDocument doc, RtfTable rtfTable, PdfPRow row, int rowNumber) : base(doc) { this.parentTable = rtfTable; this.rowNumber = rowNumber; ImportRow(row); }
/** * Creates a RtfFontList * * @param doc The RtfDocument this RtfFontList belongs to */ public RtfFontList(RtfDocument doc) : base(doc) { fontList.Add(new RtfFont(document, 0)); }
/** * Makes a copy of the given RtfBorder * * @param doc The RtfDocument this RtfBorder belongs to * @param borderType The border type of this RtfBorder * @param border The RtfBorder to copy */ protected internal RtfBorder(RtfDocument doc, int borderType, RtfBorder border) : base(doc) { this.borderType = borderType; this.borderPosition = border.GetBorderPosition(); this.borderStyle = border.GetBorderStyle(); this.borderWidth = border.GetBorderWidth(); this.borderColor = new RtfColor(this.document, border.GetBorderColor()); }
public RtfListLevel(RtfDocument doc, RtfList parent) : base(doc) { this.parent = parent; templateID = document.GetRandomInt(); SetFontNumber( new RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0)))); SetBulletFont(new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0))); }
/** * Constructs a RtfBorder * * @param doc The RtfDocument this RtfBorder belongs to * @param borderType The type of border this RtfBorder is * @param borderPosition The position of this RtfBorder * @param borderStyle The style of this RtfBorder * @param borderWidth The width of this RtfBorder * @param borderColor The colour of this RtfBorder */ protected internal RtfBorder(RtfDocument doc, int borderType, int borderPosition, int borderStyle, float borderWidth, Color borderColor) : base(doc) { this.borderType = borderType; this.borderPosition = borderPosition; this.borderStyle = borderStyle; this.borderWidth = (int) Math.Min((borderWidth * TWIPS_FACTOR), 75); if (this.borderWidth == 0) { this.borderStyle = BORDER_NONE; } if (borderColor == null) { this.borderColor = new RtfColor(this.document, new Color(0, 0, 0)); } else { this.borderColor = new RtfColor(this.document, borderColor); } }
/** * Constructs a RtfInfoElement based on the given Meta object * * @param doc The RtfDocument this RtfInfoElement belongs to * @param meta The Meta object this RtfInfoElement is based on */ public RtfInfoElement(RtfDocument doc, Meta meta) : base(doc) { infoType = meta.Type; content = meta.Content; }
/** * Constructs a new RtfStylesheetList for the RtfDocument. * * @param doc The RtfDocument this RtfStylesheetList belongs to. */ public RtfStylesheetList(RtfDocument doc) : base(doc) { this.styleMap = new Hashtable(); }
/** * Constructs a new RtfColorList for the RtfDocument. Will add the default * black and white colours. * * @param doc The RtfDocument this RtfColorList belongs to */ public RtfColorList(RtfDocument doc) : base(doc) { colorList.Add(new RtfColor(doc, 0, 0, 0, 0)); colorList.Add(new RtfColor(doc, 255, 255, 255, 1)); }