/** * <summary>Begins a content block.</summary> * <param name="frame">Block boundaries.</param> * <param name="xAlignment">Horizontal alignment.</param> * <param name="yAlignment">Vertical alignment.</param> */ public void Begin( RectangleF frame, XAlignmentEnum xAlignment, YAlignmentEnum yAlignment ) { this.frame = frame; this.xAlignment = xAlignment; this.yAlignment = yAlignment; lastFontSize = 0; // Open the block local state! /* * NOTE: This device allows a fine-grained control over the block representation. * It MUST be coupled with a closing statement on block end. */ container = baseComposer.BeginLocalState(); boundBox = new RectangleF( frame.X, frame.Y, frame.Width, 0 ); BeginRow(); }
/** * <summary>Begins a content block.</summary> */ public void Begin( RectangleF frame, AlignmentXEnum alignmentX, AlignmentYEnum alignmentY ) { this.frame = frame; this.alignmentX = alignmentX; this.alignmentY = alignmentY; // Open the block local state! /* * NOTE: This device allows a fine-grained control over the block representation. * It MUST be coupled with a closing statement on block end. */ container = baseComposer.BeginLocalState(); boundBox = new RectangleF( frame.X, frame.Y, frame.Width, 0 ); BeginRow(); }
/** * <summary>Ends the content block.</summary> */ public void End() { // End last row! EndRow(true); // Block translation. container.Objects.Insert( 0, new ModifyCTM( 1, 0, 0, 1, boundBox.Left, // Horizontal translation. -boundBox.Top // Vertical translation. ) ); // Close the block local state! baseComposer.End(); container = null; }