This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
4D View Pro Print Attributes

4D View Pro Language    


 

 

4D View Pro print attributes allow you to control all aspects of printing 4D View Pro areas. These attributes are handled by the following commands:

Column and row attributes are used to specify the beginning, end, and repetition of columns and rows.

 

PropertyTypeDescription
columnEndlongintThe last column to print in a cell range.

Default value = -1 (all columns)

columnStartlongintThe first column to print in a cell range.

Default value = -1 (all columns)

repeatColumnEndlongintThe last column of a range of columns to print on the left of each page.

Default value = -1 (all columns)

repeatColumnStartlongintThe first column of a range of columns to print on the left of each page.

Default value = -1 (all columns)

repeatRowEndlongintThe last row of a range of rows to print on the top of each page.

Default value = -1 (all rows)

repeatRowStartlongintThe first row of a range of rows to print at the top of each page.

Default value = -1 (all rows)

rowEndlongintThe last row to print in a cell range.

Default value = -1 (all rows)

rowStartlongintThe first row to print in a cell range.

Default value = -1 (all rows)

Header and footer attributes are used to specify text or images in the left, right, and center header/footer sections.

 

PropertyTypeDescription
footerCentertextThe text and format of the center footer on printed pages.
footerCenterImagepicture | text*The image for the center section of the footer.
footerLefttextThe text and format of the left footer on printed pages.
footerLeftImagepicture | text*The image for the left section of the footer.
footerRighttextThe text and format of the right footer on printed pages.
footerRightImagepicture | text*The image for the right section of the footer.  
headerCentertextThe text and format of the center header on printed pages.
headerCenterImagepicture | text*The image for the center section of the header.
headerLefttextThe text and format of the left header on printed pages. 
headerLeftImagepicture | text*The image for the left section of the header.
headerRighttextThe text and format of the right header on printed pages.
headerRightImagepicture | text*The image for the right section of the header.

* If using text type, pass the filepath (absolute or relative) of the image. If you pass a relative path, the file should be located next to the database structure file. In Windows, the file extension must be indicated. No matter the type used to set an image, the image itself (not a reference) is stored in the 4D View Pro area and is returned by VP Get print info.

The following special characters allow the automatic addition or formatting of information in the header and footer when the 4D View Pro area is printed. 

 

CharacterDescriptionExampleResult
&Escape character(see examples below)     
PCurrent pageprintInfo.headerLeft:="This is page &P." This is page 5. 
NPage countprintInfo.headerLeft:="There are &N pages."There are 10 pages. 
DCurrent date (yyyy/mm/dd format)printInfo.headerLeft:="It is &D."It is 2015/6/19. 
TCurrent timeprintInfo.headerLeft:="It is &T."It is 16:30:36.
GImageprintInfo.headerLeftImage:=smiley
printInfo.headerLeft:="&G"
 
SStrikethroughprintInfo.headerLeft:="&SThis is text."This is text.
UUnderlineprintInfo.headerLeft:="&UThis is text."This is text.
BBoldprintInfo.headerLeft:="&BThis is text."This is text.
IItalicprintInfo.headerLeft:="&IThis is text."This is text.
"Font prefixprintInfo.headerLeft:="&\"Lucida Console\"&14This is text."
KText Color prefixprintInfo.headerLeft:="&KFF0000This is text."This is text. 
FWorkbook nameprintInfo.headerLeft:="&F"2019 Monthly Revenue Forecasts
ASpreadsheet nameprintInfo.headerLeft:="&A"June 2019 revenue forecast 

Margins  

Margin attributes are used to specify the 4D View Pro area margins for printing. Expressed in hundreds of an inch.  

PropertyTypeDescription
marginobject The print margins
 

 Property  Type  Description
 top  longint Top margin, in hundredths of an inch.

Default value = 75

 bottom  longint Bottom margin, in hundredths of an inch.

Default value = 75

 left  longint Left margin, in hundredths of an inch.

Default value = 70

 right  longint Right margin, in hundredths of an inch.

Default value = 70

 header  longint Header offset, in hundredths of an inch.

Default value = 30

 footer  longint Footer offset, in hundredths of an inch.

Default value = 30

Orientation attributes are used to specify the direction the printed page layout. 

Note: This attribute defines rendering information only.

 

PropertyTypeDescription
orientationlongint Page orientation 
 
Constant Value Comment
vk print page orientation landscape 2

Landscape orientation

vk print page orientation portrait 1

Portrait orientation. (default)

Page  

Page attributes are used to specify general document print settings.

 

PropertyTypeDescription
blackAndWhitebooleanPrinting in black and white only.
Note: PDFs are not affected by this attribute. Colors in PDFs remain.

Default value = "false"

centeringlongintHow the contents are centered on the printed page:
 
Constant Value Comment
vk print centering both 3

Printing is centered both horizontally and vertically on the page

vk print centering horizontal 1

Printing is centered horizontally on the page.

vk print centering none 0

Printing is not centered. (default)

vk print centering vertical 2

Printing is centered vertically on the page.

firstPageNumberlongintThe page number to print on the first page.

Default value = 1

pageOrderlongint The order pages are printed:
 
Constant Value Comment
vk print page order auto 0

Printing order is determined automatically. (default)

vk print page order down then over 1

Pages are printed in descending order, then across.

vk print page order over then down 2

Pages are printed across, then descending order.

pageRangetextThe range of pages for printing
qualityFactorlongintThe quality factor for printing (1 - 8).  The higher the quality factor, the better the printing quality, however printing performance may be affected.

Default value = 2

useMaxbooleanOnly columns and rows with data are printed.

Default value = "true"

zoomFactorrealThe amount to enlarge or reduce the printed page.

Default value = 1

Paper size attributes are used to specify the dimensions or model of paper to use for printing. There are two ways to define paper size:

  • Custom size - height and width attributes 
  • Standard size - kind attribute 

 

PropertyTypeDescription
paperSizeobjectPaper dimensions (height, width) or specific format (kind) for printing.  
 

 Property  Type  Description
 height  longint Height of the paper, in hundredths of an inch.
 width  longint Width of the paper, in hundredths of an inch.
 kind  text Name of standard paper size (e.g., A2, A4, legal, etc.) returned by GET PRINT OPTION.

Default value = "letter"

Scale  

Scale attributes are used to specify printing optimization and adjustments.

 

PropertyTypeDescription
bestFitColumnsbooleanColumn width is adjusted to fit the largest text width for printing.

Default value = "false"

bestFitRowsbooleanRow height is adjusted to fit the tallest text height for printing. 

Default value = "false"   

fitPagesTalllongintThe number of vertical pages (portrait orientation) to check when optimizing printing. 

Default value = -1

fitPagesWidelongintThe number of horizontal pages (landscape orientation) to check when optimizing printing. 

Default value = -1

Show / Hide attributes are used to specify the visibility (printing) of 4D View Pro area elements.  

 

PropertyTypeDescription
showBorderbooleanPrints the outline border.

Default value = "true"

showColumnHeaderlongint Column header print settings
 
Constant Value Comment
vk print visibility hide 1

The header is not visible.

vk print visibility inherit 0

Inherits the settings from the sheet (default)

vk print visibility show 2

The header is visible on every page.

vk print visibility show once 3

The header is visible once.

showGridLinebooleanPrints the gridlines.  

Default value = "false"

showRowHeaderlongint Row headers print settings
 
Constant Value Comment
vk print visibility hide 1

The header is not visible.

vk print visibility inherit 0

Inherits the settings from the sheet (default)

vk print visibility show 2

The header is visible on every page.

vk print visibility show once 3

The header is visible once.

Watermark attributes are used to superimpose text or an image onto the 4D View Pro area.

 

PropertyTypeDescription
watermarkcollectionCollection of watermark settings.

Default value: undefined

 

 Property  Type  Description
 [ ].height  longint The height of the watermark text / image.
 [ ].imageSrc  picture | text* The watermark text / image.
 [ ].page  text The page(s) where the watermark is printed.

For all pages: "all"
For specific pages: page numbers or page ranges separated by commas. Ex.: "1,3,5-12"

 [ ].width  longint The width of the watermark text / image.
 [ ].x  longint The horizontal coordinate of the top left point of the watermark text / image.
 [ ].y  longint The vertical coordinate of the top left point of the watermark text / image.

  * If using text type, pass the filepath (absolute or relative) of the image. If you pass a relative path, the file should be located next to the database structure file. In Windows, the file extension must be indicated. No matter the type used to set an image, the image itself (not a reference) is stored in the 4D View Pro area and is returned by VP Get print info.

 
 



See also 

VP Get print info
VP SET PRINT INFO

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)