With the VP PRINT and VP EXPORT DOCUMENT commands, you can now print a document or create a PDF version of it. However, in order to create an appealing document for your customer, you not only need to print a document, but also add headers, footers, define the zoom, define the paper orientation, and so on. With 4D v18, it’s all possible thanks to the VP SET PRINT INFO command that allows you to define these attributes and more in your document!
You can define specific printing options for each sheet with VP SET PRINT INFO. These attributes are used to prepare the document before a PDF export or printing. Of course if you save your document, they’re saved with it.
$printInfo.headerCenter:="4D View Pro"
$printInfo.footerRight:="This is page &P of &N pages."
$printInfo.orientation:=vk print page orientation landscape
$printInfo.centering:=vk print centering horizontal
$printInfo.showRowHeader:=vk print visibility hide
$printInfo.showColumnHeader:=vk print visibility hide
VP SET PRINT INFO ("ViewProArea";$printInfo)
Export into PDF
You can now export a document in PDF format with the VP EXPORT DOCUMENT command. This export uses the information from VP PRINT INFO and automatically embeds all of the fonts used in your document into the PDF file to ensure a correct and similar rendering. As for .xlsx exports, you can pass an optional formula that will be called once the export is finished.
VP EXPORT DOCUMENT ("viewProArea";"C:\\tmp\\order.pdf";$options)
Print a document
To allow the end user to print a document, use the VP PRINT command.
VP PRINT ("ViewProArea";vk current sheet)
This feature is the first step toward printing 4D View Pro documents. Other features are coming soon. Stay tuned!
In the meantime, you can test exporting PDFs and document printing with the HDI above.