Announcement

Collapse
No announcement yet.

Cant print from okluar - lpr no such file or directory

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cant print from okluar - lpr no such file or directory

    Hi,

    Its strange, but nothing is going on when i am trying to print from okular.

    I can print from LibreOffice or evince or gimp but not from okular...

    I've try to run okular from command line and when I push OK (to print sth) after few seconds this popsup (in command line):

    lpr: no such file or directory

    any clues ?

    #2
    Have you checked Okulars Configuration settings? What is identified for printing?
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Originally posted by Snowhog View Post
      Have you checked Okulars Configuration settings? What is identified for printing?
      sure... for some reason okular by default is choosing print to PDF, so I am changing to my default printer and ... nothing . There is no window popup or anything... just this line in cli.

      I am guessing that somehow after processing file okular is failing to pass proper printer name to lpr or failing to give proper after - processed filename to lpr.

      Comment


        #4
        Is your error message exactly "lpr: no such file or directory"?

        I ask because if I try to use lpr on a non-existent file I get
        Code:
        ! lpr zinnias
        lpr: Error - unable to access "zinnias" - No such file or directory
        This maybe suggests that some different lpr is running. The usual lpr in *ubuntu is the one that comes with CUPS, IMO a bit of a beast for end users. Does man lpr * say "Apple Inc." near the top? (CUPS comes from Apple.)

        lpstat -t might be informative, but lpstat shows jobs that have reached CUPS, and your error suggests they're not getting that far.

        A slightly desperate option is to install evince, the Gnome counterpart to okular. They both use the same library for printing, something called "poppler", so if the problem is in there evince won't help; happened to me once, but on other occasions successfully printed.

        * Or type Alt-f2 help <Enter>, double click Unix Manual pages, click Section 1, and find lpr.
        Regards, John Little

        Comment


          #5
          I can print form lpr , and its works perfectly.
          Just when I start okular from CLI (command line) I just getting this:
          lpr: No such file or directory

          evince is working fine or libreoffice or lpr

          londo@londo-X750JB:~$ lpstat -t
          scheduler is running
          system default destination: Hewlett-Packard_HP_LaserJet_Professional_P_1102w
          device for Hewlett-Packard_HP_LaserJet_Professional_P_1102w: ipp://npi57e75a.local:631/printers/Laserjet
          device for HP_LaserJet_P1005_192_168_0_13: implicitclass:HP_LaserJet_P1005_192_168_0_13
          device for HP_LaserJet_P1005_raspberrypi: implicitclass:HP_LaserJet_P1005_raspberrypi
          Hewlett-Packard_HP_LaserJet_Professional_P_1102w accepting requests since pią, 19 sty 2018, 10:31:43
          HP_LaserJet_P1005_192_168_0_13 accepting requests since pon, 22 sty 2018, 13:08:59
          HP_LaserJet_P1005_raspberrypi accepting requests since pon, 22 sty 2018, 13:08:53
          printer Hewlett-Packard_HP_LaserJet_Professional_P_1102w is idle. enabled since pią, 19 sty 2018, 10:31:43
          printer HP_LaserJet_P1005_192_168_0_13 is idle. enabled since pon, 22 sty 2018, 13:08:59
          printer HP_LaserJet_P1005_raspberrypi is idle. enabled since pon, 22 sty 2018, 13:08:53

          Comment


            #6
            gwenview is also affected by the problem:
            while printing gwenview and running gwenview form cli there is a message:
            QPainter::begin(): Returned false
            QPainter::viewport: Painter not active
            alignment= 132
            QPainter::setViewport: Painter not active
            QPainter::setWindow: Painter not active

            Comment


              #7
              How many printers do you have? I have an HP and everything including gwenview and okular print just fine. One difference that stuck out right away; my installation shows "no system default destination"

              Please Read Me

              Comment


                #8
                this one is wireless printer (was ok under mint)
                device for Hewlett-Packard_HP_LaserJet_Professional_P_1102w: ipp://npi57e75a.local:631/printers/Laserjet
                printer Hewlett-Packard_HP_LaserJet_Professional_P_1102w is idle. enabled since pią, 19 sty 2018, 10:31:43

                rest of them are just network printers...

                Click image for larger version

Name:	printer.jpg
Views:	1
Size:	47.0 KB
ID:	643735

                Comment


                  #9
                  Well, for my sins, this exact problem struck me today:
                  Code:
                  ! okular bar.ps
                  lpr: No such file or directory
                  Printing to a wired ethernet, newish Brother inkjet, from a wired desktop. Printing has been great from Kubuntu. Okular has worked, printing things like movie tickets.

                  As far as I can tell from the CUPS logs, the job was not getting into CUPS at all. There's all sorts of stuff logged when printing, and not a peep when attempting to print from okular.

                  In my case, though, lpr didn't work, but CUPS was involved, it thought the job was printing successfully. The printer's display panel would display something for a small fraction of a second, barely perceptible. No app printed.

                  I mucked around in System settings, printers. Two entries showed for the printer, one of which, if I delete it, reappears a few seconds later. So I deleted the other one, and printing from anything in Kubuntu stopped working, not even a test page.

                  I mucked around some more, and added a printer through KDE system settings; originally the shell script from Brother added the printer. I got a test page, and lpr started working, and so did Okular. I still have the printer entry that resurrects itself, which has the same name as the other; there is a description you can edit in settings, but nothing uses it.

                  So, I wish I could tell the OP what of my flailing and cursing made a difference.

                  I did change permissions on the CUPS spool directory /var/spool/cups with sudo chown -R g+rwx so that I could look at things without sudo, but I doubt that has anything to do with it. I did try deleting ~/.cups/lpoptions because that worked for somebody years ago, but it only had one line "Default Brother_MFC_J5330DW", and that somebody's lpoptions had some binary junk. It had no effect. When adding the printer through system settings I chose ipp: and there was a choice of three printers with similar names, I picked one at random.
                  Regards, John Little

                  Comment


                    #10
                    Under DjView there is Printer name: (invalid printer),

                    Click image for larger version

Name:	Spectacle.TJ8716.jpg
Views:	1
Size:	16.8 KB
ID:	643798

                    and if I try to click on Choose and choose my printer from dialog box, after accepting , it remains same (invalid printer)

                    Comment


                      #11
                      I'm running into the same problem. I ran okular from the command line under strace and see the following errors right around the time of the "lpr: No such file or directory" error.

                      openat(AT_FDCWD, "/etc/cups/lpoptions", O_RDONLY) = -1 ENOENT (No such file or directory)
                      openat(AT_FDCWD, "/home/b-jazz/.cups/lpoptions", O_RDONLY) = -1 ENOENT (No such file or directory)
                      ppoll([{fd=-1}, {fd=-1}, {fd=-1}, {fd=29, events=POLLIN}], 4, NULL, NULL, 8lpr: No such file or directory
                      I'm not sure if it is related or how to fix it, but maybe someone will find this useful.

                      Comment


                        #12
                        On my setup there is no /etc/cups/lpoptions file. It is only in /home/jerry/.cups/lpoptions and contains the name of my printer as defined by the ppd I used. Its permission is 644.

                        ppoll is a polling call using /usr/bin/lpoptions, which is a
                        :~$ file /usr/bin/lpoptions
                        /usr/bin/lpoptions: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=51f6d5c8e84b62e4043fa92e5a68d9e771f02eff, stripped
                        Purging CUPS may not be a helpful move because there are, on my system 41 files, libraries and apps related to CUPS and printers and printing. However, reinstalling CUPS and ALL of its dependencies could help clear up any missing dependencies. And, deleting all the configured printers in CUPS a/or HPLIP and then re-entering them may help.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Originally posted by londo View Post
                          sure... for some reason okular by default is choosing print to PDF, so I am changing to my default printer and ... nothing
                          That's the thing. Okular is always printing to PDF by default, as well as other software does. It's changeable yet in many cases (like this line) it screws everything up, so you ought to let it be printed as pdf and edit it after then with every tool for a purpose of https://edit-pdf.pdffiller.com/ like this one or Master PDF, as an example

                          Comment

                          Working...
                          X