# Printing problem

**URL:** <https://forum.servoy.com/t/printing-problem/1361>\
**Category:** Classic Servoy\
**Created:** [February 25, 2004, 12:08pm UTC](https://forum.servoy.com/t/printing-problem/1361 "2004-02-25T12:08:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjemichael](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cjemichael](https://forum.servoy.com/u/cjemichael)\
**Post date:** [February 25, 2004, 12:08pm UTC](https://forum.servoy.com/t/printing-problem/1361/1 "2004-02-25T12:08:17Z")

</div>

Is there any way you can set a method to print the first page of a document to one paper tray (i.e. letter head) and the remaining pages to another tray (i.e. plain paper).

This would be very useful for printing multipage invoices, form letters etc?

Any ideas?

Chris

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 2, 2004, 2:56pm UTC](https://forum.servoy.com/t/printing-problem/1361/2 "2004-03-02T14:56:23Z")

</div>

This is not possible, the java printing API’s from SUN does not support this action… ![:(]( "Sad")

---

<div class="post-metadata">

**Author:** ![WiderGates](https://avatars.discourse-cdn.com/v4/letter/w/e8c25b/32.png) [@WiderGates](https://forum.servoy.com/u/WiderGates)\
**Post date:** [March 3, 2004, 3:40am UTC](https://forum.servoy.com/t/printing-problem/1361/3 "2004-03-03T03:40:44Z")

</div>

This are very, very bad news.

My customers print about 1000 - 3000 invoices every 1. of a month with 1 to 50 pages each (now in FileMaker, but we want change to Servoy).  
The first page should be printed on letter head and the other on plain paper. How can this be done. You donM-4t mean that anyone shall sort this?

Sorry, but if thereM-4s no possibility I canM-4t sell my solution to them.  
And IM-4m very sad to say this.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 3, 2004, 7:25am UTC](https://forum.servoy.com/t/printing-problem/1361/4 "2004-03-03T07:25:40Z")

</div>

Jan, is there a way, to assign print-jobs to different printers?

I have asked this feature for a while ago, don’t know where it is on the wishlist!

Like for instance you than install 2 printer drivers pointing to the same printer. One with the default paperfeed 1 and one with the default paperfeed on 2

We also have software, which is not compatible with such feature , and always solved it, this way.

Just thinking!

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 3, 2004, 8:36am UTC](https://forum.servoy.com/t/printing-problem/1361/5 "2004-03-03T08:36:55Z")

</div>

Thanks for your suggestion HJK, I think that whould work…the only question remains where to store default form printer info?

I think there are 3 options:  
1)in the form (not handy when selling to multiple customers having different printers)  
2)in the client properties (every end user has to set the default printer per form)  
3)in a (separate) property file downloaded by client and editted by developer on the server, containing something like:  
printer.crm=hpLJ1000  
printer.crm.orders=hp2200  
where the first line is the default printer and the second line an exeption for a form

In my opinion option 3 is the best we could provide… in this case WiderGates can print the first page via a form (and specific printer) followed by the other pages via other form (and other printer)

Let us know your thoughts.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 3, 2004, 8:53am UTC](https://forum.servoy.com/t/printing-problem/1361/6 "2004-03-03T08:53:51Z")

</div>

> 3)in a (separate) property file downloaded by client and editted by developer on the server, containing something like:  
> printer.crm=hpLJ1000  
> printer.crm.orders=hp2200

But how to handle if the client, is at the other side of the world?  
Can you use that property file in a method?  
Does it work, if I do a print-preview first and than push the print-button?

I think it would be handy, that if a standard printer (in such file) is not found, that there will be an error-message to catch, you than can provide a method that opens the standard printer-dialog, with the local printer of the client?

---

<div class="post-metadata">

**Author:** ![cjemichael](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cjemichael](https://forum.servoy.com/u/cjemichael)\
**Post date:** [March 3, 2004, 9:41am UTC](https://forum.servoy.com/t/printing-problem/1361/7 "2004-03-03T09:41:55Z")

</div>

Our ‘solution’ is to place hi res colour jpg/gif images of the stationery header and footer on the first page header and first page footer of the relavant forms - e.g. estimates, invoices, purchase orders etc.

In a general solution, this can be done by having these images stored in media fields - so it makes it easy to update for each client.

Then the clients print to a colour printer.

Since you can now get a decent networkable colour laser for less than 1500 Euro and the running costs are not too high, this actually works out cheaper than using pre-printed letter head - unless you are talking very high volume.

An added advantage of this is that you can use the same method and form to print to a PDF and email the printed output - thus saving paper (although the receipient will probably still print it out) and postage costs.

Probably not the ideal solution for everyone, but works for us.

Chris

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 3, 2004, 10:09am UTC](https://forum.servoy.com/t/printing-problem/1361/8 "2004-03-03T10:09:14Z")

</div>

My colleague Jan Aleman had an even better Idea, we add a function **controller.setPreferredPrinter(name)** which the developer can use to set a prefered printer by name, so the developer can get/store the printer names where he wants (ie. database table/server file retrieved via url) and set the name when he thinks fit the need, based on (security) user group based on office locations etc.

> HJK:  
> Does it work, if I do a print-preview first and than push the print-button?

For this you whould need ‘onPrintCmd’ on a form I guess?

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 3, 2004, 10:13am UTC](https://forum.servoy.com/t/printing-problem/1361/9 "2004-03-03T10:13:47Z")

</div>

WONDERFULL! ![:!:]( "Exclamation") ![:D]( "Very Happy")

onPrintCmd would certainly do the trick! I think.

Than we also need: getPrinters()?  
Or am I wrong?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 4, 2004, 12:36pm UTC](https://forum.servoy.com/t/printing-problem/1361/10 "2004-03-04T12:36:53Z")

</div>

controller.setPreferredPrinter(name) will be availeble in Servoy 2.0 rc8

> Than we also need: getPrinters()?

whould only deliver the local machine printer names which is of almost no use in large companies with printer for each department…

---

<div class="post-metadata">

**Author:** ![cjemichael](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cjemichael](https://forum.servoy.com/u/cjemichael)\
**Post date:** [March 4, 2004, 4:26pm UTC](https://forum.servoy.com/t/printing-problem/1361/11 "2004-03-04T16:26:17Z")

</div>

Anyone know how to import grahpics/images (jpg/gif/png) and get them to print at more than 72dpi???

I need to have a client logo printed on a layout at a decent (300dpi) resolution.

Ta

Chris

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 4, 2004, 4:40pm UTC](https://forum.servoy.com/t/printing-problem/1361/12 "2004-03-04T16:40:54Z")

</div>

set form property printScale to 400% to print ~300dpi (normal = 72 dpi)

---

<div class="post-metadata">

**Author:** ![cjemichael](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cjemichael](https://forum.servoy.com/u/cjemichael)\
**Post date:** [March 4, 2004, 4:48pm UTC](https://forum.servoy.com/t/printing-problem/1361/13 "2004-03-04T16:48:59Z")

</div>

Doesn’t this mean you have to scale everything on the page by 4x?

This would be a real pain since I have to redo all my print layouts.

Let me know.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 4, 2004, 5:46pm UTC](https://forum.servoy.com/t/printing-problem/1361/14 "2004-03-04T17:46:40Z")

</div>

I think **getPrinters** would still be useful, even if it only lists the printers a user has configured. But combined with the other possibilty, we could offer a user “his” printers in a valuelist, store that in a table and use it later with setPreferredPrinter(name).

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 4, 2004, 5:50pm UTC](https://forum.servoy.com/t/printing-problem/1361/15 "2004-03-04T17:50:57Z")

</div>

I agree with Patrick!

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 4, 2004, 6:04pm UTC](https://forum.servoy.com/t/printing-problem/1361/16 "2004-03-04T18:04:31Z")

</div>

> cjemichael:  
> Doesn’t this mean you have to scale everything on the page by 4x?

What else whould you expect?, or are you suggesting that we should print scaled images (cropped on a label) with a higher resolution? (which is possible)

---

<div class="post-metadata">

**Author:** ![cjemichael](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cjemichael](https://forum.servoy.com/u/cjemichael)\
**Post date:** [March 15, 2004, 1:07pm UTC](https://forum.servoy.com/t/printing-problem/1361/17 "2004-03-15T13:07:00Z")

</div>

I think the most useful solution would be if you could either specify the scaling/resolution of images (as an image property) OR if the resolution was determined by the image automatically (e.g. if you place a 600dpi image on the form, then it prints at this resolution).

I imagine many users would want to add graphics (e.g. logos) to forms for say invoices. To scale the whole form up by 400% to get hi res output is a lot of work and does not seem logical.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 16, 2004, 10:11am UTC](https://forum.servoy.com/t/printing-problem/1361/18 "2004-03-16T10:11:40Z")

</div>

will be availeble in Servoy 2.0 rc10

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 16, 2004, 10:21am UTC](https://forum.servoy.com/t/printing-problem/1361/19 "2004-03-16T10:21:46Z")

</div>

Jan, does this mean this is implemented for images only?  
or text, labels etc, too?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [March 16, 2004, 12:24pm UTC](https://forum.servoy.com/t/printing-problem/1361/20 "2004-03-16T12:24:39Z")

</div>

highres. image printing is availble for all scaled images

[Next page](https://forum.servoy.com/t/printing-problem/1361.md?page=2)
