IPXC_ContentCreator::ShowTextBlock Method

From Tracker Software 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.


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);


[in] Value of LPWSTR containing the text that needs to be shown.
[in] Pointer to PXC_Rect containing the rectangle into which the text will be placed.
[in] Pointer to PXC_Rect containing the clip that would be applied to the text. Can be null.
[in, defaultvalue(0)] Value of ULONG containing the draw text flags.
[in, defaultvalue(-1)] Value of LONG containing the length of the text.
[in, defaultvalue(NULL)] Pointer to IPXC_CharFormat containing the text's custom character format.
[in, defaultvalue(NULL)] Pointer to IPXC_ParaFormat containing the text's custom paragraph format.
[in, defaultvalue(NULL)] Pointer to IPXC_DrawTextCallbacks containing the callbacks.
[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.


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