maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Printing with N900 (https://talk.maemo.org/showthread.php?t=56932)

kureyon 2010-10-02 08:54

Re: Printing with N900
 
Quote:

Originally Posted by rotoflex (Post 827170)
It looks like Apple is working toward wireless printing from their iphone, ipad, etc. now:

No doubt they will claim that they invented the whole notion of wireless printing (or at least the fanbois will), even though Nokia had some sort of wireless printing thingumajig as far back as at least the E70. But the difference between Nokia's and Apple's version is probably that Apple's work :)

woody14619 2010-10-05 19:53

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 831350)
Maybe you should upload the repackaged libpam to the repos.

Well, I have a few problems on that. One is that I can't for the life of me find it's garage. It looks like it was uploaded as a binary image, so maybe it doesn't have one? Second, I've not made/submitted a package, and am not up to snuff on how to do it (even after prodding a bit... it's complex to put it mildly).

Understand, what I did was a hack. Literally all I did was un-ar the debian, un-tar the control files, delete "ba" out of the first line of the postinst script and re-tar/ar the whole thing back into the original debian. I didn't change the content files at all, nor did a re-build anything source code wise. This was purely a config script issue (which is why the MD5 signature for the content tar hasn't changed, so dpkg isn't complaining about it).

Were there a web interface where I could check out/in the script to fix it and trigger a build I would happily do that. If that exists and I just missed it, please do let me know where it is and I'll be happy make the change. But the system I found (requiring a build environment, dependency source packages installed, a key setup for talking to the SCM system, etc) is a little much for me to pick up right now to make a 2 character change... (Especially when the maintainer is active and chatty... ;) )

mase 2010-10-05 23:29

Re: Printing with N900
 
Just check the sources folder in extras-devel.
My used sources are there.

malandante 2010-10-24 11:58

Re: Printing with N900
 
Quote:

Originally Posted by filologen (Post 741034)
Just tried to install cups-pdf, but there are dependency problems since libpaper-utils is missing, cf. http://maemo.org/packages/package_in...s-pdf/2.4.8-3/

I had the same problem. Has anyone been able to install cups-pdf?

Arifa 2011-01-13 04:54

Re: Printing with N900
 
I have been trying to compile cups in armel target but getting this error

libtool: compile: cannot determine name of library object from `libcups.la'

can u please let me know how we can solve it

Thanks

mani 2011-01-17 07:44

Re: Printing with N900
 
Thank you Mase for the great work ! ! !

I have been trying to get this working on my N900. I followed the steps given here to install the packages.

But when I try to add printers using http://localhost:631/ It doesn't list any printers.
And I couldn't find lpadmin binary, for configuring from command line. Is there package I missed out while installing ?

After getting this working, I want to add Printing support for FreOffice.

freemangordon 2011-01-17 07:55

Re: Printing with N900
 
install cups-client package

mani 2011-01-17 10:14

Re: Printing with N900
 
Quote:

Originally Posted by freemangordon (Post 922071)
install cups-client package

I have already installed this package, But din't work.

freemangordon 2011-01-17 10:57

Re: Printing with N900
 
strange, i have installed cups and cups-client and have lpadmin on my phone. btw there is hidden dependency to bash, you need it installed otherwise configuration script of one of cups dependencies fails. and you need to start lpadmin as root. sorry, seems caanot help any further

mani 2011-01-17 11:13

Re: Printing with N900
 
Quote:

Originally Posted by freemangordon (Post 922180)
strange, i have installed cups and cups-client and have lpadmin on my phone. btw there is hidden dependency to bash, you need it installed otherwise configuration script of one of cups dependencies fails. and you need to start lpadmin as root. sorry, seems caanot help any further

Thanks for your help, I figured it out. I hadn't installed cups-pdf package. After installing, It listed one PDF device. Now It asks for a username/password. I tried root/rootme but it din't work.

Now trying to use lpadmin to configure my printer.


Quote:

Originally Posted by malandante (Post 849405)
I had the same problem. Has anyone been able to install cups-pdf?

I din't dig in to the reason for the error, But installing this package would allow you to install cups-pdf. Some how apt doesn't find libpaper-uitls package in the repo.

http://maemo.org/packages/package_in...-utils/1.1.21/

theonelaw 2011-01-17 11:23

Re: Printing with N900
 
3 Attachment(s)
Quote:

Originally Posted by freemangordon (Post 922180)
strange, i have installed cups and cups-client and have lpadmin on my phone. btw there is hidden dependency to bash, you need it installed otherwise configuration script of one of cups dependencies fails. and you need to start lpadmin as root. sorry, seems caanot help any further

Bash ? I am preparing to give this all a try,
from what you observe it would be better to install bash first then the
cups packages ?

I just finished installing the power46 and am ready to give cups a go.

Updated:=====================

<I had reflashed, installed powerk46, mc and a few other tools>

I installed bash for good measure,
I eventually installed the cups
(apt-get install cups)
and then, distracted, moved on to some other things

eventually came back to the cups issue and went to
http://localhost:631/

and was astonished to find both a Cups pdf printer (home machine)
and my hp wifi printer (automagically) installed and ready.
I did not even need to install them - they just came up that way,
which in all the times I have fooled around with Cups
I have never seen that happen !

Of course I printed a test page

Now to find a way to trick some app (FileBox maybe ?)
into printing (blind ?)...

Update 2:

After apt-get install cups-client
I checked both evince and the adobe reader,
neither had the printing bits in the packages.
Checked the Gnumeric package as well...
Still looking for a way to print...

hung up on apt-get install cups-pdf due to papersize,
but this is not a showstopper

theonelaw 2011-01-18 19:23

Re: Printing with N900
 
1 Attachment(s)
Ok Done:
everything mentioned in the previous posts needs to be done

It works like This, from scratch, as root, in terminal:

I installed bash but from all the broken bits it did not seem to help. YMMV

Code:

apt-get install cups
apt-get install cups-client

get the pam stuff posted previously here:
http://talk.maemo.org/attachment.php...3&d=1285973625

Code:

dpkg --install libpam0g_1.0.1-maemo1_armel.deb
dpkg --configure -a

download this for the cups-pdf printer:
http://repository.maemo.org/pool/mae...1.21_armel.deb

Code:

dpkg --install libpaper/libpaper-utils_1.1.21_armel.deb
apt-get install cups-pdf

In /etc/cups/cupsd.conf enter this:

Code:

<Location /admin>
  AuthType BasicDigest
  AuthClass Group
  AuthGroupName cupsadm
  Encryption Required
  Order allow,deny
  Allow @LOCAL
</Location>

make the missing symlink:
Code:

ln -s /usr/lib/cups/backend-available/* /usr/lib/cups/backend/
now restart the server to digest all the kludgework:
Code:

/etc/init.d/cups restart
get yourself a password
Code:

lppasswd -g lpadmin -a root
in browser navigate to: http://localhost:631/
Anything you do there will require user root and password you entered
Code:

lppasswd -a user
will give you a user account to play with.

Certainly there will be a lot more to do beyond this,
but at this point you can do things like:

As a user in terminal - no need the root account anymore

Take a pdf already designed for the proper paper size
and convert it to postscript:

Code:

pdf2ps some.pdf some.ps
then aim the postscript file at the printer

Code:

lp some.ps
(for default printer)
or
Code:

lp -P printer_as_named_in_cups some.ps
(for a specific printer)

As of here the only printing is commandline printing postscript files,
but that can be anything you can cram into a pdf file so it is a lot.

Leafpad will not recognize the printer - it is broken inside leafpad.
forget FreOffice - its got nothing to print with, already checked
Maybe there is another application ported over from source
with legacy printing stubs that could be used, still looking for that.

what we need now is to clean all this up into a single batch install,

then we can start putting simple printing handles in all the applications.

Cheers

jstokes 2011-01-18 19:31

Re: Printing with N900
 
Quote:

Originally Posted by theonelaw (Post 922194)
I checked both evince and the adobe reader,
neither had the printing bits in the packages.

I don't have CUPS so I don't know for sure, but have you tried Ctrl-P in Evince?

freemangordon 2011-01-18 19:37

Re: Printing with N900
 
and by issuing lp <filename> you should be able to print any supported type of document. btw who is cups maintainer maybe one should ask him to fix the broken bits.

theonelaw 2011-01-18 19:45

Re: Printing with N900
 
Quote:

Originally Posted by jstokes (Post 923246)
I don't have CUPS so I don't know for sure, but have you tried Ctrl-P in Evince?

Opens the same broken printer dialogue we see in leafpad
which may indicate a place we could fix it device-wide maybe?:o

theonelaw 2011-01-18 19:53

Re: Printing with N900
 
Quote:

Originally Posted by freemangordon (Post 923249)
and by issuing lp <filename> you should be able to print any supported type of document. btw who is cups maintainer maybe one should ask him to fix the broken bits.

Think it is Mase who gas been away almost a month

He had a diary comment is all I can find outside the thread.

If he has drifted off (as many have) then it may need someone else's care.

Other than text and pdf what do you think could be printed this way?

I was thinking it might not be too difficult to make a simple widget
to pull in pdf's and batch-file print them. maybe....:confused:

jstokes 2011-01-18 19:54

Re: Printing with N900
 
Quote:

Originally Posted by theonelaw (Post 923252)
which may indicate a place we could fix it device-wide maybe?:o

In GTK+ itself, I think the file gtk/gtkprintunixdialog.c is the file that would be needed. Unfortunately my GTK+ skills are not that hot and I don't have a Linux install (so I can use the SDK) anymore

theonelaw 2011-01-18 20:09

Re: Printing with N900
 
Quote:

Originally Posted by jstokes (Post 923259)
In GTK+ itself, I think the file gtk/gtkprintunixdialog.c is the file that would be needed. Unfortunately my GTK+ skills are not that hot and I don't have a Linux install (so I can use the SDK) anymore

Looks sexy - I will have a run at this one. thanks! :D:D:D

woody14619 2011-01-18 20:21

Re: Printing with N900
 
FYI: Fenec/Firefox for N900 has printing support. :) I think Opera does as well.

theonelaw 2011-01-19 20:30

Re: Printing with N900
 
Quote:

Originally Posted by woody14619 (Post 923279)
FYI: Fenec/Firefox for N900 has printing support. :) I think Opera does as well.

Opera does not.
Still the same old Opera it ever was - menu made with crayons
and no dangerous functions like print or save or anything
that any reasonable person might want in a browser.

Thanks for suggesting though - it was worth checking anyway

Will check fennec next
but I think I am definitely on to implementing a widget/app
for printing with the gtk + 2 dialogue (I hope!)

mase 2011-01-20 04:16

Re: Printing with N900
 
Maybe take a look at gtklp. With the version I packaged there is no
fileopen dialog. You have to use gtklp <filename>. The newer version
offers such a dialog, but I did not get it packaged for Maemo.
But all this makes no sense, if no application offers a printing function.

theonelaw 2011-01-20 06:23

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 924351)
Maybe take a look at gtklp. With the version I packaged there is no
fileopen dialog. You have to use gtklp <filename>. The newer version
offers such a dialog, but I did not get it packaged for Maemo.
But all this makes no sense, if no application offers a printing function.

Thanks for all you have done, mase,
will have a run at gtklp.

I am printing pdfs which I need quite often as they end up in emails
which I often get when in differing places.

I am beginning to see there are only a handful of us who
have any interest in printing from the n900,
but it is an awesome thing to be able to do if you travel.

rotoflex 2011-01-20 13:52

Re: Printing with N900
 
Even with few applications that support printing, being able to print files from the command line (or from a dedicated file-printing application) will be very useful.

theonelaw 2011-01-21 18:52

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 924351)
...The newer version
offers such a dialog, but I did not get it packaged for Maemo.
But all this makes no sense, if no application offers a printing function.

After
apt-get install gtklp

I ran it and it works but the permissions I have set up
are everywhere bogged wrongly, not sure how I got there but
I reckon I will reflash and do it all again.
<yes, i did run openssl and install certs>
<yes, i did edit cupsd.conf down to a wide open permissions level, no joy>

repeat:
After
apt-get install gtklp

I am able in xterm, as user or as root
select a file and successfully send it to the cups server ,
where it sits quietly 'pending' because I somehow screwed up
permissions somehow.
I think this goes back to the Bash-libpam issue - I will check further
when I finish some other work I am currently busy with.

Note - GtkLp also has some sort of permissions issues,
because when you run it as user you get coal-black background,
but when run as root it has the proper colors.
Just a cosmetic observation, but it may indicate other underlying
permissions issues.

So far I see printing dialogues in leafpad and evince,
but by far the sexiest print dialogue is in claws-mail :D
which i find particularly exciting.

theonelaw 2011-01-23 08:11

Re: Printing with N900
 
Triumph of a sorts

Ok after getting caught up on some other things back to gtklp

I had forgotten to give admin permissions to root and localhost
when I got this right I could then run gtklp with no more problems,

First - gtklp has a desktop shortcut.
Using this shortcut eliminates the ability to choose a file
> This is the thing I would like to fix next <

second - if you launch gtklp in xterm as user
(remembering I have installed bash and use it instead of sh or ash,
- not yet sure if these are necessary but suspect they are atm)
the select file dialogue works just fine,
and prints as expected
(so far successfully printed .pdf, txt, jpg from cli
using just -> gtklp and then browsing the file selector to choose file)

if you ever launch gtklp as root (why?) you will need to go back
and change the permissions back to 666 on all files
in the /.gtklp folder in your home folder.

Still a hairy mess to install but right now I can print to any printer
I can get into the cups server.
And without exhausting all my printer ink I expect gtklp
can print many filetypes you might want to print,
but there needs a lot more testing to be sure.

Like I said, I have successfully printed the following so far:

.txt :D (simple text files)
.jpg :D (just picked a jpg and printed it - did not even check what it was
formatted to be, may not work for just any jpg ?)
.png :D (just hacked a quick sketch in mypaint oand saved as pic.png)
.pdf :D
.ps :D

Trying to print spreadsheets through gtklp = no joy,
these need to be run through the native app but they are not ready yet
although with something like gnumeric you can save as pdf
and maybe that is good enough for the moment
.gnumeric does not work
.xlsx does not work
.ods does not work

===================================
If you use claws-mail you can print by setting:
in menu find configuration -> actions
and add something like this:

Menu name:
Code:

printout
Command:
Code:

| gtklp '%f' &
the '|' pipes the output from claws into gtklp
'%f' sends the compliant file
and the '&' <important> closes the claws dialogue
and allows gtklp to open its dialogue for your command

This makes my day,
as I have no fixed office and no desk I can count on
in all the offices I visit,
but it will permit me to print whatever I can set up whenever I want
as the ultimate roadwarrior hack - printing emails from the handphone

theonelaw 2011-01-24 02:02

Re: Printing with N900
 
Quote:

Originally Posted by theonelaw (Post 926537)
First - gtklp has a desktop shortcut.
Using this shortcut eliminates the ability to choose a file
> This is the thing I would like to fix next <

Ok fixed that, here is how:

edit in:
/usr/share/applications/gtklp.desktop
/usr/share/applications/hildon/gtklp.desktop

Change the line that says
Code:

Exec=/usr/bin/gtklp
to
Code:

Exec=/usr/bin/gtklp ""
(I am sure this is some simple way of dealing with the
sort of reticulated convolutions and backflip-handstands
required for Hildon/osso-mime-type/ or whatever it is so
deeply hidden in the documentation I have not yet found it setting)

voila - the gtklp desktop icon will now launch with the file selection
menu intact, ready for your printing pleasure.


Other news,
downloaded the latest bleeding edge Fennec (firefox)
and see the print dialogue is available only on websites which
have a print button,
but it has the Firefox "save to pdf" feature which means printing
webpages is just a couple of clicks of detour. (MicroB does not)


Ditto for gnumeric - just save to pdf I guess,
but not sure yet how you can ensure the page format is correctly
arrived at...

My next task is to get the default print dialogue working
that already exists in evince, leafpad, etc.

printcap checked
gtk-print-backend checked
what next?

gtklp works and those others do not - what is the difference
in the way gtklp calls up the printcap info
as compared to these others?
I think it must be something simple, but who knows...

rotoflex 2011-01-24 13:58

Re: Printing with N900
 
Quote:

Originally Posted by theonelaw (Post 927077)
Ok fixed that, here is how:

edit in:
/usr/share/applications/gtklp.desktop

I do not have that file in /usr/share/applications after installing gtklp.

theonelaw 2011-01-24 14:13

Re: Printing with N900
 
Quote:

Originally Posted by rotoflex (Post 927368)
I do not have that file in /usr/share/applications after installing gtklp.

hmmmm,

how did you install it?

I think I did apt-get install gtklp ? or another way ?

Let me look I will post it

my mistake, too blur:
it is in /usr/share/applications/hildon/

rotoflex 2011-01-24 17:49

Re: Printing with N900
 
Thank you, but I am now getting a connection refused when I try to reach http://localhost:631/

I removed then re-installed cups & edited the cupsd.conf file, but still can't bring it up. Any ideas?

db_tobago 2011-01-24 20:31

Re: Printing with N900
 
Thanks for figuring this out guys.

After installing cups/cups-client/cups-pdf/gtklp how much rootfs space are you left with?


Regards

theonelaw 2011-01-25 05:09

Re: Printing with N900
 
Quote:

Originally Posted by rotoflex (Post 927521)
Thank you, but I am now getting a connection refused when I try to reach http://localhost:631/

I removed then re-installed cups & edited the cupsd.conf file, but still can't bring it up. Any ideas?

My hack approach was drowning in permission problems,
so I went into cupsd.conf and set everything wide open
(which violates everything you would ever want to do security-wise,
but my goal was just to 'make this work' :( and go back and sort out
why libpam and the permissions game :rolleyes: are not working later)

allow root
allow localhost
order allow, deny

I had to chmod virtually everything in /etc/cups to 755

here is my cupsd.conf file:
Code:

#
#
#  Sample configuration file for the Common UNIX Printing System (CUPS)
#  scheduler.  See "man cupsd.conf" for a complete description of this
#  file.
#

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel warning

Printcap /etc/printcap


# Administrator user group...
SystemGroup lpadmin


# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow localhost
  Allow root
  Allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
#  AuthType BasicDigest
#  AuthClass Group
#  AuthGroupName lpadmin
#  Encryption Required
  Order allow,deny
  Allow localhost
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
#  AuthType Default
#  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job-related operations must be done by the owner or an administrator...
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
#    Require user @OWNER @SYSTEM
    Order allow,deny
    Allow localhost
    Allow root
    Allow all
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
#    AuthType Default
#    Require user @SYSTEM
    Order allow,deny
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
#    AuthType Default
#    Require user @SYSTEM
    Order deny,allow
    Allow localhost
    Allow root
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
#    Require user @OWNER @SYSTEM
    Order allow,deny
    Allow localhost
    Allow root
    Allow all
  </Limit>

  <Limit All>
    Order allow,deny
    Allow localhost
    Allow root
    Allow all
  </Limit>
</Policy>
#
#

there are possibly other things I neglected to mention,
but my focus was on getting this to work
so if you have problems just ask, I will soon reflash and do the whole thing again from scratch to make sure I have it right.
I am using power-kernel 46 but I do not think that has any effect on things.
I have a few other apps installed but nothing which should have made a difference to cups

cheers

theonelaw 2011-01-25 05:19

Re: Printing with N900
 
Quote:

Originally Posted by db_tobago (Post 927631)
Thanks for figuring this out guys.

After installing cups/cups-client/cups-pdf/gtklp how much rootfs space are you left with?


Regards

56m at the moment,
but this is my test unit and I have been shovelling so that may
due to a lot of other thing (fennec was big)

I have (in addition to the cups/gtklp/libpam) on my test unit the following:

fennec
opera
gps recorder
mc
claws-mail
conky
mypaint
freoffice
gnumeric
xtide
leafpad
sketch
advanced clock plugin
filebox
fapman
PyGTKeditor
Canola (don't even remember loading this one or why !)
PDF reader
gps data logger
notes
evince
panorama
vumeter
copernicium
rootsh

but you don't need any of this to for cups (i think?)

db_tobago 2011-01-27 01:05

Re: Printing with N900
 
no. finally able to do command line printing after soft linking the backend folder.

nice work you guys. this brick/phone keeps improving

mase 2011-02-10 17:56

Re: Printing with N900
 
There is still the problem, that the cups install script cannot execute
getcwd. That's the reason, that the symlinks are not made.
I recompiled leafpad and removed the --disable-print. However after
ctrl-p no printers are listed.

mase 2011-02-12 05:15

Re: Printing with N900
 
You don't need to install the whole cups server to print with a network printer.
I described in the first post.

mase 2011-02-15 14:06

Re: Printing with N900
 
I have rebuilt leafpad and removed the printer disable in the rules file.
However there is not print entry in the menu and ctrl+p opens a printer
dialog without any printer listed.
I don't know, how to enable printer support here. Maybe the gtk libs
have been build with printing disabled.

mase 2011-02-15 16:54

Re: Printing with N900
 
Got it!
I repackaged gtk+2.0 with printing support. I've incremented the package version
to avoid the update to the original version. You don't have to install the dev and
doc packages on the device.
http://rapidshare.com/files/448095611/gtk_2.0.tar.gz

Here is leafpad with printing support. You have to press ctrl+p to open the
printing dialog. There is no menu option to enter it.
http://rapidshare.com/files/44809682...emo2_armel.deb

mase 2011-02-15 16:58

Re: Printing with N900
 
Here is abiword:
http://rapidshare.com/files/44809749...emo5_armel.deb

mase 2011-02-15 17:45

Re: Printing with N900
 
As pictureviewer I wanted to rebuild evince, but I failed with gnome-doc-utils,
which is not installable and I could not rebuild it. Any other suggestions (must be
gtk2.0)?
Also gnumeric did not provide printing after a rebuild.

peterleinchen 2011-02-16 22:23

Re: Printing with N900
 
Keep on mase !
And thanks. :)


All times are GMT. The time now is 04:57.

vBulletin® Version 3.8.8