Printing form with WP Area, background images not printed


I try to print a form with several WP areas. The area sizes are set dynamically on the form. This works fine. But when trying to but an image into the WP area, behind the text, it’s not printed by print form.
I also tried to put the image as background, then it’s printed, but the size of the background image does not fit automatically when I change the size of WP area object.

Any ideas what else I could try?


4D V18R2, 4Dv18R3

Sorry, i not realy understand what you do,
when you said you print a form with several WP areas?

Normally you print a wp document,
not a “print form with one or more wp-areas in it”.

But anyway,
maybe you forgot a correct setting/configuring of wp view

Look to on this docu:

When you have a inline image, no problem.
But in that moment where you define the picture as behind/inFront of text,
it is no longer a inline-image, it is a image in a separat layer with free positioning.
The positions belong to the pictures anchor definitions than,
default you got a picture with coordinates anchored to currend wp page.
To print thuch pictures, minimum “view mode paged” is needed.

I canot give a full exlanantion, because about wp and about pictures in wp
there are lot of features and lot of what must study before.

This are only any wild tipps, i do not know your exactly situation+usecase+codes.
Maybe you understand all correct and you found any exotic wp-mistake,
but first check if you done all well and in accordance with 4d wp docu.

…in addition…
wk page view mode (pageMode)
Mode for displaying the 4D Write Pro document in the form area onscreen.
Possible values (string):

  • “draft”: draft mode with basic document properties
  • “embedded”: view mode suitable for embedded areas
  • “page”: most complete view mode, which includes page outlines, orientation, margins, breaks, headers and footers, etc.
View mode for printing
Regardless of the View mode set for the 4D Write Pro area (see Configuring View properties), it is always printed as in the Embedded mode when you use a 4D printing command such as Print form. In this case, the following Appearance settings are not taken into account for the 4D Write Pro form objects: Page view mode (always “Embedded”), Show headers, Show footers, Show page frame (always “No”), Show hidden characters (always “No”).

This means when you use for printing the command “Print form”
than you got always (whatever you set)
the print of the “Embedded mode”
and not from a maybe wished “Page mode”
So you lost a your page definitions in print result.

These picture anchors only viewed/printed in “Page mode” !!!
(not available in a EmbeddedMode with printing commands such as “Print form”…)
(for page mode printing command “WP PRINT” is needed)

  • anchorOrigin
  • anchorPage
  • anchorSection

Examples for picture anchor set with command “WP Add picture”

Take care too on this,
when a user set in wp-area in page-mode a text behind text with Toolbar/Contextmenu
this is different from when user sets this in embedded mode.
Maybe modes are not fully compatible,
so it can happens when user create+see his picture in page-mode
and after it change mode to “embedded mode” this picture (created in page-mode)
is not shown anymore in embedded.

Thank you for you explanation. I use the embedded WP area as a label editor. I’m not happy with the user experience of the 4D label editor. So my client expect less options and easier handling. Before v18 I used forms to print. But because forms are unusable for customized deploying, I went over to do everything in WP and/or WP embedded areas. It would be nice if a WP area could be used instead of a form in label editor. But I did not find any way to do so, or to use a customizable form with a WP area on it.

Another way could be to create a WP document with a table for the labels. But the tables in WP cannot be fixed on a constant height like in word (?) and even if I could, I would need to place logo and footer on each label.
So, I tried to use a generic form with WP areas on it. With a json settings document I set the positions automatically and I can control the number of labels, filling them with the necessary data in the WP document and print them with print form. I works fine… The top logo can be placed into the text flow that’s fine, but I’m not able to put a ‘footer’ on the label with a constant position.
So I tried to put a background image with the logo and footer, but this does not scale ‘correctly’. To put an image behind the text would be a solution too, but as you mention it does not seem to be supported.

Maybe I’m wrong in not using the 4D label editor…

Thank you for your help. I try to find an other solution.

Use WP-Area never in Page-Mode when you want to print the resulting wp-document
with e.g. “Print form”.

Test/Explore as a normal user who create+edit a wp-doc in a WP-Area in a 4D-Form.
The WP-Area in form must setted to Embedded-View (never Page-View) before beginning
create/edit a wp-doc in it as a normal end-user. The wp-contextmenu shows you exactly what can be done and what specials not available in Embedded-View. Create a complete wp-doc in Embedded-Mode and than use this wp-doc to print in embedded mode. Never swich the mode with document, and make for e.g. some pict defines in page-mode and than try to switcht this to embedded. Its the same when you define onTheFly a generic wp-doc with wp-commands. Do not try to set page mode (what can not used with PrintForm) and do not try actions what only available in Page-View-Mode, use the way what is available with Embedded-View-Mode and do all your definitions from beginning in a setted Embedded-View-Mode.

I had no experience with Label-Editor.
It can be, there exists more than one Product called LabelEdtitor.

Did you know?, you can download sources from 4D
and you can re-write your own LabelEditor.

Other 4D sources/examples

As i said, i have realy never any practice experience with any Label-Editor project!
But sometimes i hear what other developers doing…
There exists maybe too some different version from maybe a alternative label-editor in pure svg.
And i am not remember exactly, but maybe sometimes i heared that this svg-label-editor is a very good solution as alternative in some use-cases to 4DLabelsEditor.
So give them a try, maybe this one uses a lot of 4d developers (not only for japan),
and i know that miyako from 4D-japan makes always good work (very usefool tools/components/plugins without bugs, ready to use products not only experiments):