Image Viewer CP ActiveX Control

PDFDrawTextAlign

 

Align Text on specific page of PDF.
 

Public Function PDFDrawTextAlign( _
   ByVal iPageNo As Integer, _
   ByVal iX As Integer, _
   ByVal iY As Integer, _
   ByVal strText As String, _
   ByVal iFontID As Integer, _
   ByVal iFontSize As Integer, _
   ByVal iAlign As Integer  
) As bool

 

Parameter

iPageNo
 specifies page no. for draw a text. The first page is zero index.

The iX, iY unit is Centimeters. 10000 = 1 CM.
iX
 specifies the x-coordinate of the upper-left corner of the text to draw.

iY
 specifies the y-coordinate of the upper-left corner of the text to draw.

strText
 the string of text to draw.

iFontID
 specifies the font ID.

iFontSize
 specifies the size of font.

iAlign
 specifies the text alignment to the left, right, center. 
0 - Left Alignment
1 - Center Alignment
2 - Right Alignment


Return Value

Return true if successful.
Return false if failed.


Example

   

Visual Basic Syntax
ImageViewer1.PDFOutputPDFA = True
ImageViewer1.PDFInitAnnotation
FontID = ImageViewer1.PDFAddFont("Arial", True, True)
ImageViewer1.PDFSetTextColor 255, 0, 255
ImageViewer1.PDFDrawTextAlign 0, 10000, 250000, "www.viscomsoft.com", FontID, 18, 1