Customising Printing

Here you can post about the issues related to modifications performed manually (not through the kiosk wizard). Example: swapped kernel, added 3rd party modules or files.
Please describe in detail what has been changed and hopefully other kiosk user will be able to help.
Porteus team wont resolve bugs posted in this category as we support only modifications made by the kiosk wizard.
Post Reply
mcmurchy1917
White ninja
White ninja
Posts: 6
Joined: 17 Aug 2014, 08:41
Distribution: Slackware
Location: Britain

Customising Printing

Post#1 by mcmurchy1917 » 17 Aug 2014, 09:22

I'm from Britain so the standard page size is A4. However, Porteus Kiosk has the default page size of Letter.

As I didn't want users of the kiosk to have to change this setting each time Firefox refreshed itself, this is what I did -

Generated a new module called 903-bristolwireless-settings.xzm, using dir2xzm, from this directory

Code: Select all

903-bristolwireless-settings
903-bristolwireless-settings/home
903-bristolwireless-settings/home/guest
903-bristolwireless-settings/home/guest/.mozilla
903-bristolwireless-settings/home/guest/.mozilla/firefox
903-bristolwireless-settings/home/guest/.mozilla/firefox/c3pp43bg.default
903-bristolwireless-settings/home/guest/.mozilla/firefox/c3pp43bg.default/user.js
903-bristolwireless-settings/etc
903-bristolwireless-settings/etc/rc.d
903-bristolwireless-settings/etc/rc.d/rc.M
There are only two files in this directory rc.M and user.js.

I then used makeiso.sh and isohybrid commands to master a new version of Kiosk.

Note:

rc.M was changed to add the line lpadmin -p kiosk-printer -o PageSize=A4 as in the context below

***************
*** 60,65 ****
--- 60,66 ----
iptables -A OUTPUT -p tcp --dport 9100 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
cupsd
lpadmin -p kiosk-printer -E -v URI -m `lpinfo --make-and-model "printer_model" -m | grep ^gutenprint. | cut -d" " -f1 | head -n1`
+ lpadmin -p kiosk-printer -o PageSize=A4
fi

# Start the local setup procedure:

user.js is described as "A user.js file is an alternative method of modifying preferences, recommended for advanced users only." To generate this file I used the current version of Porteus LXDE Desktop following these steps -
  • Started LXTerminal
    Switched to root
    Amended the ppd with the command

    Code: Select all

    lpadmin -p kiosk-printer -o PageSize=A4
    made a copy of the file prefs.js in /home/guest/.mozilla/firefox/c3pp43bg.default/prefs.js calling it prefs.js.orig. Thus was so I could compare the differences later.
    Started Firefox as guest
    Printed a document in Firefox having selected the A4 page size
    Closed Firefox so that my new preferences were written to prefs.js
    Compared the differences between prefs.js.orig and prefs.js
    Used the differences to generate the file user.js
For the record my user.js contained the following

Code: Select all

user_pref("print.print_bgcolor", false);
user_pref("print.print_bgimages", false);
user_pref("print.print_colorspace", "default");
user_pref("print.print_downloadfonts", false);
user_pref("print.print_duplex", 0);
user_pref("print.print_evenpages", true);
user_pref("print.print_in_color", true);
user_pref("print.print_margin_bottom", "0.500000012107193");
user_pref("print.print_margin_left", "0.500000012107193");
user_pref("print.print_margin_right", "0.500000012107193");
user_pref("print.print_margin_top", "0.500000012107193");
user_pref("print.print_oddpages", true);
user_pref("print.print_orientation", 0);
user_pref("print.print_page_delay", 50);
user_pref("print.print_paper_data", 0);
user_pref("print.print_paper_height", "297.00");
user_pref("print.print_paper_name", "iso_a4");
user_pref("print.print_paper_size_type", 1);
user_pref("print.print_paper_size_unit", 1);
user_pref("print.print_paper_width", "210.00");
user_pref("print.print_plex_name", "default");
user_pref("print.print_resolution", 300);
user_pref("print.print_resolution_name", "default");
user_pref("print.print_scaling", "  1.00");
user_pref("print.print_shrink_to_fit", true);
user_pref("print.print_to_file", false);
user_pref("print.print_to_filename", "/home/guest/mozilla.pdf");
user_pref("print.print_unwriteable_margin_bottom", 17);
user_pref("print.print_unwriteable_margin_left", 14);
user_pref("print.print_unwriteable_margin_right", 14);
user_pref("print.print_unwriteable_margin_top", 17);
user_pref("print_printer", "kiosk-printer");
My questions are -

Was there a simpler way that would have worked?
Could PageSize be added to the wizard?

All the best and thanks for a wonderful product.

mcmurchy1917
White ninja
White ninja
Posts: 6
Joined: 17 Aug 2014, 08:41
Distribution: Slackware
Location: Britain

Re: Customising Printing

Post#2 by mcmurchy1917 » 17 Aug 2014, 10:22

It dawned on me that as Firefox was saving the last selected page size in prefs.js did I need to run the

Code: Select all

lpadmin -p kiosk-printer -o PageSize=A4
at all.

So I tested it and no I didn't need it. So my final 903-bristolwireless-settings directory just contains this

Code: Select all

903-bristolwireless-settings
903-bristolwireless-settings/home
903-bristolwireless-settings/home/guest
903-bristolwireless-settings/home/guest/.mozilla
903-bristolwireless-settings/home/guest/.mozilla/firefox
903-bristolwireless-settings/home/guest/.mozilla/firefox/c3pp43bg.default
903-bristolwireless-settings/home/guest/.mozilla/firefox/c3pp43bg.default/user.js
The instructions for building the file user.js are as described in my previous post.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4616
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Customising Printing

Post#3 by fanthom » 17 Aug 2014, 15:21

hi
Was there a simpler way that would have worked?
dont think so.
this is how i'm doing it: i'm comparing files to find an entry in prefs.js responsible for certain function and porting it to kiosk.
Could PageSize be added to the wizard?
will see what i can do about it but i'm worrying that users may request full frontend with all other settings and this will be a lot of work.
Please add [Solved] to your thread title if the solution was found.

mcmurchy1917
White ninja
White ninja
Posts: 6
Joined: 17 Aug 2014, 08:41
Distribution: Slackware
Location: Britain

Re: Customising Printing

Post#4 by mcmurchy1917 » 18 Aug 2014, 08:07

Thanks for the reply.

I sympathise, I'm sure that people out there would say my printer's got duplexing why can't I use that.

I'm perfectly happy with the way Porteus Kiosk is - nice and simply. I'm not phased by building my own modules to add some tweaks here and there. If I wanted to add duplexing I know whats steps I would need to follow.

By the way, I've been using Porteus Desktop since August 2011 primarily to back up various PC's but also when I need a Linux distro away from home. I've built modules for rdiff-backup and ecryptfs-utils

loukamoulox
White ninja
White ninja
Posts: 17
Joined: 12 Aug 2014, 12:48
Distribution: Porteus Kiosk
Location: France

Re: Customising Printing

Post#5 by loukamoulox » 02 Sep 2014, 09:24

i've encountered the same problem, default printing was in letter format.
Personnaly, i just add this settings in my pref.js and it works perfectly :
user_pref("print.print_paper_height", "297,00");
user_pref("print.print_paper_name", "iso_a4");
user_pref("print.print_paper_size", 3);
user_pref("print.print_paper_size_type", 1);
user_pref("print.print_paper_size_unit", 1);
user_pref("print.print_paper_width", "210,00");
user_pref("print.always_print_silent", true);
i also added the silent print, cause i dont want user to make changes in the print popup.

hope this can help you

mcmurchy1917
White ninja
White ninja
Posts: 6
Joined: 17 Aug 2014, 08:41
Distribution: Slackware
Location: Britain

Re: Customising Printing

Post#6 by mcmurchy1917 » 03 Sep 2014, 07:20

Thanks for the update, I think I'll stick with the user.js method, it seems easier for me.

However, I have incorporated your suggestion about silent print.

Thanks again

Post Reply