PDFPAGE_SetTextRenderingMode
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method sets the text rendering mode.

Mode

Example

Description

trmFillText

Fill text.

trmStrokeText

Stroke text.

trmFillAndStroke

Fill, then stroke text.

trmNeitherFillNorStoke

Neither fill nor stroke text (invisible).

trmFillTextAndAddPathForClipping

Fill text and add to path for clipping.

trmStrokeTextAndAddPathForClipping

Stroke text and add to path for clipping.

trmFillStrokeAndAddPathForClipping

Fill, then stroke text and add to path for clipping.

trmAddTextToPathForClipping

Add text to path for clipping.

Syntax

HRESULT PDFPAGE_SetTextRenderingMode (
TxTextRenderingMode mode
)
Parameters
mode
One of the TxTextRenderingMode value.

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method sets the mode that determines how the character outline is used. By default, the character outline is used for filling operations in which the inside of the outline path is painted with the current fill color in a solid pattern. This state may be changed by calling this function.

Equivalent in new interface: IPDFDocument4::SetTextRenderingMode.

Example

Setting Text Rendering Mode

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;

PDF.PDFPAGE_SetRGBColorFill(0, 0.4, 0.2);
PDF.PDFPAGE_SetRGBColorStroke(1, 0, 0);
PDF.PDFPAGE_SetActiveFont('Verdana', False, False, False, False, 36.0, 0);

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillText);
PDF.PDFPAGE_TextOut(20, 20, 0.0, 'ABCdef');

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmStrokeText);
PDF.PDFPAGE_TextOut(20, 70, 0.0, 'ABCdef');

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillAndStroke);
PDF.PDFPAGE_TextOut(20, 120, 0.0, 'ABCdef');

PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();

PDF->PDFPAGE_SetRGBColorFill(0, 0.4, 0.2);
PDF->PDFPAGE_SetRGBColorStroke(1, 0, 0);
PDF->PDFPAGE_SetActiveFont("Verdana", False, False, False, False, 36.0, 0);

PDF->PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillText);
PDF->PDFPAGE_TextOut(20, 20, 0.0, "ABCdef");

PDF->PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmStrokeText);
PDF->PDFPAGE_TextOut(20, 70, 0.0, "ABCdef");

PDF->PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillAndStroke);
PDF->PDFPAGE_TextOut(20, 120, 0.0, "ABCdef");

PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();

PDF.PDFPAGE_SetRGBColorFill(0, 0.4, 0.2);
PDF.PDFPAGE_SetRGBColorStroke(1, 0, 0);
PDF.PDFPAGE_SetActiveFont("Verdana", False, False, False, False, 36.0, 0);

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillText);
PDF.PDFPAGE_TextOut(20, 20, 0.0, "ABCdef");

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmStrokeText);
PDF.PDFPAGE_TextOut(20, 70, 0.0, "ABCdef");

PDF.PDFPAGE_SetTextRenderingMode(TxTextRenderingMode.trmFillAndStroke);
PDF.PDFPAGE_TextOut(20, 120, 0.0, "ABCdef");

PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc

PDF.PDFPAGE_SetRGBColorFill 0, 0.4, 0.2
PDF.PDFPAGE_SetRGBColorStroke 1, 0, 0
PDF.PDFPAGE_SetActiveFont "Verdana", False, False, False, False, 36.0, 0

PDF.PDFPAGE_SetTextRenderingMode 0 'trmFillText
PDF.PDFPAGE_TextOut 20, 20, 0.0, "ABCdef"

PDF.PDFPAGE_SetTextRenderingMode 1 'trmStrokeText
PDF.PDFPAGE_TextOut 20, 70, 0.0, "ABCdef"

PDF.PDFPAGE_SetTextRenderingMode 2 'trmFillAndStroke
PDF.PDFPAGE_TextOut 20, 120, 0.0, "ABCdef"

PDF.EndDoc

See Also

Reference