### Rich text

This sample shows how to change the appearance of text to draw rich text.

In PdfDocument, the text can be filled with any color. It can also be stroked or filled and stroked simultaneously.

The drawText's options argument has the fill and stroke properties. Leave these properties empty to indicate that the text should be filled (default). Set stroke to true to indicate that the text should be stroked. Set fill and stroke, both to true to indicate that text should be both stroked and filled.

Each call to drawText starts a new paragraph. To indicate that subsequent text should be placed right after the previous one, set the options argument's continued property to true.

    doc.drawText("Lorem ", null, null, { continued: true });
    doc.drawText("ipsum.");

#### Setting up the fill color

The fill color can be specified in two ways:

- By passing a brush directly to drawText as the options.brush property.

      doc.drawText("Lorem", null, null, {
          brush: new wijmo.pdf.PdfSolidBrush("#ff000") // or brush: "#ff000"
      });

- By changing the default document brush using the doc.setBrush method first. This brush will be used if you call drawText method without passing a brush to it.

      doc.setBrush(new wijmo.pdf.PdfSolidBrush("#ff000")); // or doc.setBrush("#ff000");
      doc.drawText("Lorem");

#### Setting up the stroke color

Like the fill color, the stroke color can be specified in the same way by passing a pen to the options.pen property or doc.setPen method.

For more information about brushes and pens, see the "Drawing graphics" topic.

PdfDocument doesn't differentiate between text color and vector graphics color, so changing the default document brush or pen affects the vector graphics API too.