4D v17.1

Converting 4D Write documents to 4D Write Pro

Home

 
4D v17.1
Converting 4D Write documents to 4D Write Pro

Converting 4D Write documents to 4D Write Pro    


 

4D Write Pro can open and convert 4D Write documents while retaining almost all of their specific properties. If 4D Write documents were stored in a BLOB field, the contents of a 4D Write can be recovered simply using the WP New command:

  // we retrieve the contents of a 4D Write area in a 4D Write Pro area
 [WRITEAREAS]AreaNTWP:=WP New([WRITEAREAS]AreaNT_)

Unlike 4D Write, 4D Write Pro is not a plug-in but is integrated with 4D itself. Note that 4D Write Pro uses the same license as 4D Write, so it must be installed in your application for the feature to be enabled.

4D Write Pro objects can retrieve 4D Write documents in the following ways:

  • 4D Write files of the last generation (i.e. .4w7 or .4wt files) stored on disk can be converted directly:

     C_OBJECT($docWritePro)
     $docWritePro:=WP Import document("myFile.4w7")
     WP EXPORT DOCUMENT($docWritePro;"myFile.4wp")
  • Older 4D Write files (.4w6) must be previously converted in .4w7 files. 
    Warning: Since the 4D Write plug-in is not available on 64-bit applications, you must convert your 4D Write documents using a 32-bit version of 4D (up to 4D v17 R4). 

      // Convert .4w6 files in .4w7 files with 4D Write commands
     $offscreen:=WR New offscreen area
     WR OPEN DOCUMENT($offscreen;"myFile.4w6";"4WR6")
     WR SAVE DOCUMENT($offscreen;"myFile.4w7";"4WR7")
     WR DELETE OFFSCREEN AREA($offscreen)
     
  • 4D Write documents stored in BLOB fields must be moved to Object fields and then, be converted using the WP New command.

      // From a BLOB field to an Object field
      // [DocWRITE]WriteBLOBArea_ is a BLOB field
      // [DocWRITE]WriteProArea is an object field
     [DocWRITE]WriteProArea :=WP New([DocWRITE]WriteBLOBArea_//conversion to 4D Write Pro
     WR DELETE OFFSCREEN AREA($offscreen)
  • 4D Write documents stored in picture fields must be previously moved to BLOB fields. To do this, you can:

    • (recommended) use the Extract4W7 component, which converts 4D Write picture fields to 4D Write BLOB fields directly from a 4D 64-bit version. For more information on the Extract4W7 component, please refer to this blog post.  

    • or, execute the following code on a 4D 32-bit version (up to 4D v17 R4, as stated above):
        // From a Picture field to an Object field, through a BLOB
        // [DocWRITE]WritePictArea_ is a picture field
        // $Blob is a BLOB
        // [DocWRITE]WriteProArea is an Object field
       $offscreen:=WR New offscreen area
       WR PICTURE TO AREA($offscreen;[DocWRITE]WritePictArea_)
       $Blob:=WR Area to blob($offscreen;1)

Notes:

  • Check which features and objects can be imported by consulting: Which properties will be recovered from 4D Write?
  • Windows systems: 4D Write Pro features rely on Direct2D. WIth machines running Windows 7 or Windows Server 2008, make sure that the Platform Update for Windows component has been installed so that you can take advantage of the required Direct2D version.

Filtering was not enabled for 4D Write Pro documents in previous versions. If your 4D Write Pro documents reference 4D methods, they will no longer be evaluated correctly once they are converted into 4D v16 or higher. "## Error # 48" messages will be displayed instead.
In this case, you must add the methods to the list of allowed methods using the SET ALLOWED METHODS command.

New commands have been added and existing ones have evolved to work with 4D Write Pro:

 
 

 
PROPERTIES 

Product: 4D
Theme: Converting 4D Write documents to 4D Write Pro

 
HISTORY 

 
ARTICLE USAGE

Conversion to 4D v17 ( 4D v17)
Conversion to 4D v17 ( 4D v17.1)