4D v13

WR Build preview

Home

 
4D Write v13
WR Build preview

WR Build preview 


 

WR Build preview ( area ; page ) -> Function result 
Parameter Type   Description
area  Longint in 4D Write area
page  Longint in Number of the page to pass as a picture
Function result  Picture in Picture of the page

The WR Build preview command converts the page, whose number is passed in page, into a picture. The page number takes into account the page numbering as it was defined in the preferences dialog.

The picture can be stored, for instance, in a 4D picture field or in a 4D picture variable. The picture is the same size as the page. You can set the size of the picture by using the WR SET DOC PROPERTY command and by passing a value for wr paper width and wr paper height.

Note: unlike when you use WR Area to picture, the picture does not contains any 4D Write data

The returned picture is a vector-based picture. A picture that was created on Windows cannot be directly displayed on Mac OS, nor stored “as is”in a picture file (for example, using the WRITE PICTURE FILE command) since it uses the EMF format. If you want your Windows pictures to be displayed on Mac OS or in another Windows application, you need to convert the picture into a bitmap by using the following statement:
myPicture:=myPicture|myPicture.

Unlike EMF (Windows only), Pict and bitmap picture types are not platform dependent.

Note: On the contrary, Mac OS pictures can be used directly.

Example  

4D Write documents are saved into BLOB fields. You only want to print only the second page of each document. To do so, insert in the print form a picture variable (named MyImage in this example) and attach the following method to the variable:

 If(Form event=On Printing Detail)
    WR BLOB TO AREA(NewOffscreen;[MyTable]WriteBlob_)
    MyImage:=WR Build preview(NewOffscreen;2)
 End if

Then, create and execute the following project method:

 QUERY([MyTable]`Creating the selection to print
 OUTPUT FORM([MyTable];"PrintPage2") `PrintPage2 is the form used for printing
  `Creating the offscreen area used in the previous method
 NewOffscreen:=WR New offscreen area
 PRINT SELECTION([MyTable]`Printing the selection
 WR DELETE OFFSCREEN AREA(NewOffscreen`Deleting the offscreen area

 
PROPERTIES 

Product: 4D
Theme: WR Area Options
Number: 89492

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Write 6.5

 
SEE ALSO 

WR SET DOC PROPERTY