I try to print two files from the command line thus:
$ lp alpha.txt beta.txt
The lpq command gives this output:
$ lpq
HP_OfficeJet_Pro_6970_7BE7A4 is ready
Rank Owner Job File(s) Total Size
1st claus 56 alpha.txt 2048 bytes
Here, it mentions only the file alpha.txt. However, only the file beta.txt is actually printed. alpha.txt is not printed.
What might be the reason for that?
I'm running Ubuntu 22.04.1 LTS with CUPS 2.4.1.
FURTHER INFORMATION
If I use lp to print more than one file, these messages appear the /var/log/cups/error_log:
W [13/Dec/2022:16:22:19 +0100] [Job 61] /tmp/12345639a6b95: file is damaged
W [13/Dec/2022:16:22:19 +0100] [Job 61] /tmp/12345639a6b95 (offset 14802): xref not found
W [13/Dec/2022:16:22:19 +0100] [Job 61] /tmp/12345639a6b95: Attempting to reconstruct cross-reference table
FURTHER INFORMATION 2
The file name in the log starts with 12345. This neat pattern is a coincidence. Repeated attempts show that the first 5 digits of the filename appear to be the hexadecimal value of the PID of the gstoraster CUPS filter that runs as part of the printing process. So perhaps, the problem lies with that filter.
cat alpha.txt beta.txt | lp. – FedKad Dec 10 '22 at 10:20catdoesn't work if I'm printing a mixture of .txt and .pdf files. Also, I'll have to manually insert page breaks between the files. – oz1cz Dec 10 '22 at 10:26lpqcommand lists the filealpha.txt, butbeta.txtis the file that's actually printed. So somehow the print system knows about both files. – oz1cz Dec 11 '22 at 13:22which lpand trylp -- alpha.txt beta.txt– user.dz Dec 13 '22 at 12:51for f in "alpha.txt" "beta.txt"; do lp "$f"; donemakes a difference ... i.e. using the loop to send each file as a separate single argument. – Raffa Dec 13 '22 at 13:25which lpprints/usr/bin/lp. Usinglp -- alpha.txt beta.txtmakes no difference.@Raffa: Issuing two
– oz1cz Dec 13 '22 at 15:05lpcommands causes both files to be printed; and this is, of course, a useful substitute. However, the documentation forlpsays that it should be possible to print multiple files using one command, so I wonder why it doesn't work.alpha.txtis not really a plain text file and it is damaged … "missing external reference” usually happens with binary files e.g. images … Test withecho "text 1" > file1.txt && echo "text 2" > file2.txt && lp file1.txt file2.txtand see how it goes. – Raffa Dec 13 '22 at 16:09alpha.txtis absolutely a plain text file. I created it exactly as you suggest, and a hex dump of the file shows it as entirely a plain text file. Anyway, the error message is not "missing external reference" but "xref not found", which could be an internal reference created bygstoraster, if that is indeed the problem filter, as I suggested in my latest addition to the post. – oz1cz Dec 13 '22 at 16:32lpsoftware. – FedKad Dec 15 '22 at 10:21