SetTextRise
IPDFDocument4 :: Page Operations :: Text

See Also Example
Collapse All

This method sets the text rise value.

Syntax

HRESULT SetTextRise (
FLOAT rise
)
Parameters
rise
New text rise value

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

Remarks

Text rise specifies the distance to move the baseline up or down from its default location. Positive values of text rise move the baseline up. Adjustments to the baseline are useful for drawing superscripts or subscripts. The default location of the baseline can be restored by setting the text rise to 0.

Example

Adjusting the Baseline

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
fnt := PDF.AddFont('Verdana', false, false, false, false, fcDefault);
PDF.UseFont(fnt, 14);
PDF.SetTextRise(0);
PDF.ShowTextAt(30, 30, 'ABC');
PDF.SetTextRise(7);
PDF.ShowText('ABC');
PDF.SetTextRise(-7);
PDF.ShowText('ABC');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long fnt = PDF->AddFont("Verdana", false, false, false, false, fcDefault);
PDF->UseFont(fnt, 14);
PDF->SetTextRise(0);
PDF->ShowTextAt(30, 30, "ABC");
PDF->SetTextRise(7);
PDF->ShowText("ABC");
PDF->SetTextRise(-7);
PDF->ShowText("ABC");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long fnt = PDF.AddFont("Verdana", false, false, false, false, FontCharset.fcDefault);
PDF.UseFont(fnt, 14);
PDF.SetTextRise(0);
PDF.ShowTextAt(30, 30, "ABC");
PDF.SetTextRise(7);
PDF.ShowText("ABC");
PDF.SetTextRise(-7);
PDF.ShowText("ABC");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
fnt = PDF.AddFont("Verdana", false, false, false, false, 0)'FontCharset.fcDefault
PDF.UseFont fnt, 14
PDF.SetTextRise 0
PDF.ShowTextAt 30, 30, "ABC"
PDF.SetTextRise 7
PDF.ShowText "ABC"
PDF.SetTextRise -7
PDF.ShowText "ABC"
PDF.SaveToFile "test.pdf", true

See Also

Reference