ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • When should I use iMargin?
  • Logical margins and physical margins
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Defines the "logical" print margins. These margins are added to the physical margins in which nothing can be printed. Therefore, you cannot print inside the physical and logical margins.
Caution: This function cannot be used in the report editor.
Example
iMargin(20, 11, 20, 11)
// Find out the physical margins of a printer
iMargin(0, 0, 0, 0)
MarginH = (PaperHeight - iPageHeight())/2
MarginW = (PaperWidth - iPageWidth())/2
Syntax
iMargin(<Top margin> , <Bottom margin> , <Left margin> , <Right margin>)
<Top margin>: Real
Margin of the top section of page, expressed in millimeters. This margin applies from the top side of the page. If this margin is smaller than the physical top margin, the physical top margin will apply.
<Bottom margin>: Real
Margin of the bottom section of page, expressed in millimeters. This margin will be applied from the bottom side of the page. If this margin is smaller than the physical bottom margin, the physical bottom margin will apply.
<Left margin>: Real
Margin of the left section of page, expressed in millimeters. This margin will be applied from the left side of the page. If this margin is smaller than the physical left margin, the physical left margin will apply.
<Right margin>: Real
Margin of the right section of page, expressed in millimeters. This margin applies from the right side of the page. If this margin is smaller than the physical right margin, the physical right margin will apply.
Remarks

When should I use iMargin?

  • iMargin must be called:
  • iEndPrinting cancels the margins.
  • In the same document, you can define margins multiple times with iMargin. For each print, the origin of the print will use the last defined margins.
  • iMargin must not be called in the processes of a report created with the report editor.

Logical margins and physical margins

  • By default, the logical margins are set to 0. The origin (0, 0) is located in the top left corner of the sheet, taking into account the physical margin (top and left).
  • The physical print area is set to the maximum when the parameters of iMargin are all equal to 0 (default value).
Component: wd300prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help