IPXC_ContentCreator::ShowTextBlock Method

From PDF XChange PDF SDK
Jump to: navigation, search


Shows text block in the specified rectangle and calculates the text bounds. If the callbacks are specified then the callback's methods will be used.

Syntax

HRESULT ShowTextBlock([in]                       LPWSTR                   pText,
                      [in]                       PXC_Rect*                pRect,
                      [in]                       PXC_Rect*                pClip,
                      [in, defaultvalue(0)]      ULONG                    nFlags,
                      [in, defaultvalue(-1)]     LONG                     nTextLen,
                      [in, defaultvalue(NULL)]   IPXC_CharFormat*         pCharFmt,
                      [in, defaultvalue(NULL)]   IPXC_ParaFormat*         pParaFmt,
                      [in, defaultvalue(NULL)]   IPXC_DrawTextCallbacks*  pCallbacks,
                      [out, defaultvalue(NULL)]  PXC_Rect*                pTextBounds);

Parameters

pText
[in] Value of LPWSTR containing the text that needs to be shown.
pRect
[in] Pointer to PXC_Rect containing the rectangle into which the text will be placed.
pClip
[in] Pointer to PXC_Rect containing the clip that would be applied to the text. Can be null.
nFlags
[in, defaultvalue(0)] Value of ULONG containing the draw text flags.
nTextLen
[in, defaultvalue(-1)] Value of LONG containing the length of the text.
pCharFmt
[in, defaultvalue(NULL)] Pointer to IPXC_CharFormat containing the text's custom character format.
pParaFmt
[in, defaultvalue(NULL)] Pointer to IPXC_ParaFormat containing the text's custom paragraph format.
pCallbacks
[in, defaultvalue(NULL)] Pointer to IPXC_DrawTextCallbacks containing the callbacks.
pTextBounds
[out, defaultvalue(NULL)] Pointer to PXC_Rect containing the resulting bound rectangle of the given text.

Return Value

Returns S_OK if operation was successful or error code in other cases.

Remarks

If the DTF_RichText flag is specified along with the line-height parameter then if the line height is less then font size then the text will be displayed fully if no DTF_AddClip flag is additionally specified. If no DTF_AddClip is specified, then in this case the pTextBounds rectangle height will be lower then the height of the text's bound box. This can cause additional problems with positioning. If the DTF_AddClip flag is specified in such a case, then the displayed text will be clipped and the pTextBounds rectangle will be correct.

If the line-height parameter has a value that is greater then the height of the text's bound box, then the pTextBounds rectangle will have a height of the text's bound box.

See Also

IPXC_ContentCreator