4D Blog

Home Product 4D Write Pro – Direct export to PDF!

4D Write Pro – Direct export to PDF!

July 29, 2020

Product

What if I told you that with 4D v18 R4 you can export 4D Write Pro documents directly to PDF format (on both macOS and Windows), without needing to install any printer drivers or additional software? Now you can … and that’s not all! You’re also able to set several options for both the form and the content. Keep reading to learn more!

HDI: Export in PDF

Exporting in PDF format can be done in two ways:

  1. To a document on your hard drive or
  2. To a BLOB variable that can then be exported, archived, sent as an email attachment, etc.

 

You can also define a number of options in order to specify precisely what should be exported and how.

For example:

  • Does your document have headers and footers that don’t belong in your PDFs? No problem! Don’t export them.
  • Need control over images because your documents can be printed, but your PDFs are only intended to be previewed on screen? Choose the screen-optimized option.
  • Don’t need to export background images? Great! Your generated PDFs will be lighter!
  • What about links to bookmarks and external URLs? Worry not, they’re maintained.

 

Here’s some code to show you how easy setting up these options can be:

var $options : Object
var $Path : Text
$Path:=Get 4D folder(Database folder)+"Test.pdf"
$options:=New object
$options[wk visible background]:=False
$options[wk visible headers]:=False
$options[wk visible footers]:=False
$options[wk optimized for]:=wk screen
WP EXPORT DOCUMENT(WPsample;$Path;wk pdf;$options)

Something else worth mentioning, the command is thread-safe, so if you are handling multiple documents, the export will be faster since all the cores will be operational.
More information is available in the doc center. Happy exporting! 

Discuss

Tags 4D Write Pro, Export, PDF, v18 R4, v19, Word processor

Latest related posts

  • November 14, 2025

    Event Report in 4D Qodly Pro: See Every Interactions at a Glance

  • November 14, 2025

    4D Qodly Pro: Page Zoom Controls

  • November 13, 2025

    macOS Tahoe, Windows 11, which operating systems for 4D 20 and 21?

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert • After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming 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