|
|
|
|
|
- Origin and physical margins
- Managing the parameter
- Combining positions
- Printing in Java and Android
- Miscellaneous
iYPos (Function) In french: iPosY Controls the vertical position (ordinate or line) of the print cursor on the page. You can: - find out the current vertical position,
- modify the vertical position of print cursor.
Remark: When printing a Text string, the current vertical position points to the top of the string to be printed.. The bottom print line depends on the height of the fonts used in the printed line.
iHLine(0, iPageWidth(), 1)
iYPos(iYPos() + 2)
iHLine(0, iPageWidth(), 3)
iEndPrinting()
Syntax
Finding out the vertical position of print cursor Hide the details
<Result> = iYPos()
<Result>: Real Current vertical position of cursor (in millimeters).
Modifying the vertical position of print cursor Hide the details
<Result> = iYPos(<Vertical position> [, <Immediate calculation>])
<Result>: Character string Requested vertical position. <Vertical position>: Real New vertical position (Y-coordinate) of print cursor (in millimeters). <Immediate calculation>: Optional boolean - True (by default) to immediately calculate the vertical position.
- False if the vertical position must be calculated during the print (when nesting positions for example). For more details, see remarks.
Remarks Origin and physical margins The origin (0,0) is located in the upper-left corner of the sheet. This origin takes the physical printer margins into account. Each printer includes physical margins in which no printing is possible. iMargin is used to define the "logical" print margins. If logical margins have been defined, iYPos manages the vertical position according to these new margins. Managing the <Immediate Calculation> parameter When <Vertical Position> is specified in iYPos, the function performs two actions at the same time: - Returns a control character string. This control character string modifies the print position when the string is printed.
- Immediately modifies the position of print cursor
The <Immediate Calculation> parameter is used to retrieve the control character string without modifying the current position of print cursor sMonTitre is string = "Titre impression"
iDestination(iViewer)
iXPos((iPageWidth() - iTextWidth(sMonTitre))/2)
iPrint(sMonTitre)
iXPos((iPageWidth() - iTextWidth(sMonTitre))/2, False)
iPrint(sMonTitre)
iPrint(iXPos((iPageWidth() - iTextWidth(sMonTitre))/2, True) + sMonTitre)
iPrint(iXPos((iPageWidth() - iTextWidth(sMonTitre))/2, False) + sMonTitre)
When combining positions, unexpected results may occur. For example, the following code: iYPos(50)
iPrint("Première partie" + iYPos(30) + "Seconde partie")
is not equivalent to: iPrint(iYPos(50) + "Première partie" + iYPos(30) + "Seconde partie")
In the first case, the entire character string is printed at vertical position 30. In this case, function iYPos(30) is executed when the string to be printed is constructed, and therefore before the "First part" string is printed. To obtain the same result, simply use (in the first syntax) the iYPos function with the Faux parameter: the iPosY(30, Faux) function will only actually be executed during printing. The same operation can be performed by iXPos. iYPos must not be used in a parameter of iPrintWord.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|