Source/NFX/Media/PDF/PdfWriter.cs
/// <summary>
/// Writes PDF text element into file stream
/// </summary>
/// <param name="text">PDF text element</param>
Writes PDF text element into file stream
Writes PDF text element into file stream
internal void Write(TextElement text)
    {
      var escapedText = TextAdapter.FixEscapes(text.Content);
      var pdfStreamBuilder = new StringBuilder();
      pdfStreamBuilder.AppendLine("q");
      pdfStreamBuilder.AppendLine("BT");
      pdfStreamBuilder.AppendFormatLine("{0} {1} Tf", text.Font.GetResourceReference(), TextAdapter.FormatFloat(text.FontSize));
      pdfStreamBuilder.AppendFormatLine("{0} rg", text.Color.ToPdfString());
      pdfStreamBuilder.AppendFormatLine("{0} {1} Td", TextAdapter.FormatFloat(text.X), TextAdapter.FormatFloat(text.Y));
      pdfStreamBuilder.AppendFormatLine("({0}) Tj", escapedText);
      pdfStreamBuilder.AppendLine("ET");
      pdfStreamBuilder.Append("Q");
      writeStreamedObject(text.ObjectId, pdfStreamBuilder.ToString());
    }
internal void Write ( TextElement text ) { var escapedText = TextAdapter . FixEscapes ( text . Content ) ; var pdfStreamBuilder = new StringBuilder ( ) ; pdfStreamBuilder . AppendLine ( " " ) ; pdfStreamBuilder . AppendLine ( " " ) ; pdfStreamBuilder . AppendFormatLine ( " " , text . Font . GetResourceReference ( ) , TextAdapter . FormatFloat ( text . FontSize ) ) ; pdfStreamBuilder . AppendFormatLine ( " " , text . Color . ToPdfString ( ) ) ; pdfStreamBuilder . AppendFormatLine ( " " , TextAdapter . FormatFloat ( text . X ) , TextAdapter . FormatFloat ( text . Y ) ) ; pdfStreamBuilder . AppendFormatLine ( " " , escapedText ) ; pdfStreamBuilder . AppendLine ( " " ) ; pdfStreamBuilder . Append ( " " ) ; writeStreamedObject ( text . ObjectId , pdfStreamBuilder . ToString ( ) ) ; }
Writes PDF text element into file stream
Writes PDF text element into file stream
text
TextElement
PDF text element
PDF text element