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

Home

 
4D v19
VP SET PRINT INFO

VP SET PRINT INFO 


 

VP SET PRINT INFO ( vpAreaName ; printInfo {; sheet} ) 
Parameter Type   Description
vpAreaName  Text in 4D View Pro area name
printInfo  Object in Object containing printing attributes
sheet  Longint in Sheet index (current sheet if omitted)

The VP SET PRINT INFO command defines the attributes to use when printing the vpAreaName.

Pass the name of the 4D View Pro area to print in vpAreaName. If you pass a name that does not exist, an error is returned.

You can pass an object containing definitions for various printing attributes in the printInfo parameter. To view the full list of the available attributes, see 4D View Pro Print Attributes

In the optional sheet parameter, you can designate a specific spreadsheet to print (counting begins at 0). If omitted, the current spreadsheet is used by default. You can explicitly select the current spreadsheet with the following constant: 

Constant Type Value Comment
vk current sheet Longint -1 Designates current sheet of the 4D View Pro area (default)

Example  

The following code will print a 4D View Pro area to a PDF document: 

C_OBJECT($printInfo)

//declare print attributes object
$printInfo:=New object

//define print attributes
$printInfo.headerCenter:="&BS.H.I.E.L.D. &A Sales Per Region"
$printInfo.firstPageNumber:=1
$printInfo.footerRight:="page &P of &N"
$printInfo.orientation:=vk print page orientation landscape
$printInfo.centering:=vk print centering horizontal
$printInfo.columnStart:=0
$printInfo.columnEnd:=8
$printInfo.rowStart:=0
$printInfo.rowEnd:=24
$printInfo.showGridLine:=True

//Add corporate logo
$printInfo.headerLeftImage:=logo.png
$printInfo.headerLeft:="&G"

$printInfo.showRowHeader:=vk print visibility hide
$printInfo.showColumnHeader:=vk print visibility hide
$printInfo.fitPagesWide:=1
$printInfo.fitPagesTall:=1

//print PDF document
VP SET PRINT INFO ("ViewProArea";$printInfo)

//export the PDF
VP EXPORT DOCUMENT("ViewProArea";"Sales2018.pdf";new object("formula";formula(alert("PDF ready!"))))

The PDF:



See also 

4D View Pro Print Attributes
VP Convert to picture
VP Get print info
VP PRINT

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language
Number: 9814

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)