4D Blog

Home Product 4D View Pro: Manage Printing and PDF export

4D View Pro: Manage Printing and PDF export

November 4, 2019

Product

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!

HDI 4DVP PDF export and printing

Print info

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:=New object
$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.showGridLine:=False
$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.

$options:=New object
$options.formula:=Formula(AfterPDF )
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.

 

Discuss

Tags 4D View Pro, Export, PDF, Printing, Spreadsheet, v18

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • Email, Microsoft 365, Gmail
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • 4D Qodly Pro
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Google Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy