PDFPAGE_SetHorizontalScaling
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method sets the horizontal scaling factor.

Syntax

HRESULT PDFPAGE_SetHorizontalScaling (
DOUBLE factor
)
Parameters
factor
Value (in percent) of the horizontal scaling factor

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 horizontal scaling factor as a percentage. This expands or compresses the horizontal dimension of the string. The default value for this parameter is 100(%).

Equivalent in new interface: IPDFDocument4::SetTextHorizontalScaling.

Example

Changing the Horizontal Scaling

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
PDF.PDFPAGE_SetActiveFont('Verdana', false, false, false, false, 16.0, 0)
for i := 7 to 15 do
begin
    PDF.PDFPAGE_SetHorizontalScaling(i * 10);
    PDF.PDFPAGE_TextOut 20, 20 * (i - 6), 0.0, 'Text string. Scale %: ' + IntToStr(i * 10);
end;
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
PDF->PDFPAGE_SetActiveFont("Verdana", FALSE, FALSE, FALSE, FALSE, 16.0, 0)
for (int i = 7; i < 16; i++)
{
    PDF->PDFPAGE_SetHorizontalScaling(i * 10);
    CString str;
    str.Format("Text string. Scale %%: %d", i * 10);
    PDF->PDFPAGE_TextOut 20, 20 * (i - 6), 0.0, (LPCTSTR)str);
}
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
PDF.PDFPAGE_SetActiveFont("Verdana", false, false, false, false, 16.0, 0)
for (int i = 7; i < 16; i++)
{
    PDF.PDFPAGE_SetHorizontalScaling(i * 10);
    string str = String.Format("Text string. Scale %: {0}", i * 10);
    PDF.PDFPAGE_TextOut 20, 20 * (i - 6), 0.0, str);
}
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
PDF.PDFPAGE_SetActiveFont "Verdana", False, False, False, False, 16.0, 0
For i = 7 To 15
    PDF.PDFPAGE_SetHorizontalScaling i * 10
    PDF.PDFPAGE_TextOut 20, 20 * (i - 6), 0.0, "Text string. Scale %: " & (i * 10)
Next
PDF.EndDoc

See Also

Reference