Customising Printing
Posted: 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
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 -
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.
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
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 commandmade 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.Code: Select all
lpadmin -p kiosk-printer -o PageSize=A4
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
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");
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.