iTextSharp.text.pdf.PdfContentByte.ClosePathFillStroke C# (CSharp) Метод

ClosePathFillStroke() публичный метод

public ClosePathFillStroke ( ) : void
Результат void
        public void ClosePathFillStroke()
        {
            if (inText) {
                if (autoControlTextBlocks) {
                    EndText();
                } else {
                    throw new IllegalPdfSyntaxException(
                        MessageLocalization.GetComposedMessage("path.construction.operator.inside.text.object"));
                }
            }
            content.Append('b').Append_i(separator);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Renders the object in a document using a <see cref="PdfContentByte"/> by invoking the <see cref="Render(ContentWriter, Vector2D)"/> method.
        /// This method can be overridden in derived classes to specify rendering.
        /// </summary>
        /// <param name="cb">The <see cref="PdfContentByte"/> used for rendering.</param>
        /// <param name="offset">The calculated offset for the rendered item.</param>
        protected internal virtual void Render(PdfContentByte cb, Vector2D offset)
        {
            using (var writer = new ContentWriter(cb))
            {
                var stroke = this as StrokeObject;
                var fill = this as FillObject;

                bool hasstroke = stroke?.BorderColor.HasValue ?? false;
                bool hasfill = fill?.FillColor.HasValue ?? false;

                if (hasstroke)
                {
                    cb.SetLineWidth((float)stroke.BorderWidth.Value(UnitsOfMeasure.Points));
                    cb.SetColorStroke(new Color(stroke.BorderColor.Value));
                }
                if (hasfill)
                    cb.SetColorFill(new Color(fill.FillColor.Value));

                Render(writer, offset);

                if (hasstroke && hasfill)
                {
                    if (writer.CloseShape)
                        cb.ClosePathFillStroke();
                    else
                        cb.FillStroke();
                }
                else if (hasstroke)
                {
                    if (writer.CloseShape)
                        cb.ClosePathStroke();
                    else
                        cb.Stroke();
                }
                else if (hasfill)
                    cb.Fill();
            }
        }
All Usage Examples Of iTextSharp.text.pdf.PdfContentByte::ClosePathFillStroke
PdfContentByte