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

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

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

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 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