Print dialog - problems setup the paper size

Hello,

We want to print from Smart Client to a card printer Evolis Pebble 4, and we have some issues:

  1. The System print dialog is not exactly as it should and we can not choose the size of the card which is CR80 (3.37 x 2.125 inch).
  2. We didn’t succeed to print the card on landscape from the print dialog although we set the orientation to landscape and it didn’t work even on a regular HP printer. Only from the print preview it worked for the HP printer, but didn’t work for the card printer.
  3. The Print Preview dialog where a user can set the size of the card is complicated for a dummy user. He just want to click on Print and to have the card printed.

So, … to be more clearly …

  1. Besides the controller.print(); and controller.showPrintPreview(); are there any other methods for printing or printing helpers?
  2. How can I set the size of the paper, the margins and orientation (portrait/landscape) using a method, not letting the user to do this?
  3. From the regular print dialog of the system when we print a photo to the card printer, we can set the paper size, why can’t we do this from the Smart Client print dialog? The useSystemPrintDialog property is set on true.

I’ll try to provide with some screenshoots of the print dialogs later. I think it might help. I can’t do this now because I don’t have the printer with me.

Kind Regards,
Bogdan.

Bogdan,

Have a look at controller.setPageFormat()

Rob

Thank you,

I used the controller.setPageFormat() method and looks OK. I don’t know for sure that it will work, but at least, in the Print Preview dialog and printed on a regular printer looks promising. I’ll come back when have tested it on the card printer, although it might take some while.

Now, I told that I’ll show the print dialogs. Why are they different? You can see that in preferences, the Use System Dialog is checked.

Here we can choose the Card format:
[attachment=0]system_dialog.png[/attachment]

In Servoy’s Print dialog we don’t have that option, actually it’s different although the Use System Dialog property is checked.
[attachment=1]servoy_dialog.png[/attachment]

The print dialog is the system’s one, but it doesn’t looks like it.
[attachment=2]servoy_preferences.png[/attachment]

Hi,

We have the fortune these days to test the card printing directly on the printer so fortunately, we fixed the problem, and I thought to explain how the stuff was done.

It was very strange and you can laugh about it, but possible the Evolis driver has a problem, or this is how they wanted to implement, although I can’t see any logic now, so I’m thinking to write them, too. Still, if some of you knows why the print dialogs are different, it would be interesting and maybe useful for the future to know.

This is how we did it:

controller.setPageFormat(3.37, 3.37, 0, 0, 1.24, 0, 1, 1);

Very strange, taking in account that the card size is 3.37 x 2.125 inch.

  1. If I would set up the size with 3 decimals (i.e. 2.125) I would have 2 pages, so I needed to make the page higher. That’s why the top margin is 1.24 (the height of the card is actually set to 2.13 → 2.13 + 1.24 = 3.37).
  2. The biggest and difficult to figure out problem is that if the height of the card if less then the width (which, by the way, would be normal) the card image will be printed with a 90 degree rotation in the middle of the card.

So actually what we did is to set the height equals or higher then the width of the size (we did it equals), then to add the top margin, to force the card to be stuck at the bottom, and also the paper orientation to be portrait. Very strange, but this is how it worked.

All the best to all of you,
Bogdan.