Red Hat Bugzilla – Bug 857592
ASCII text files are not printed the same as ASCII C++ text files: tab characters and white space are not preserved.
Last modified: 2012-10-16 05:21:03 EDT
Description of problem:
When one uses the lp command on a .txt file, formatting of the file is lost. White spaces are converted to a single white space. Files with a .c extension are handled properly--tabs and spaces are maintained.
Version-Release number of selected component (if applicable):
Create a file with tabs and spaces. Give it a .txt extension. Print it. Rename it so it ends with .c. Print again. The two files are printed differently
Steps to Reproduce:
1. Create file test.txt with contents:
2. lp test.txt
3. mv test.txt test.c
The two files have the same contents but are treated differently. In addition, if the file has a .txt extension, it is treated like a .c file if the first two characters in the file are //.
Tabs are replaced by a single space
Tabs should be maintained, in other words, there should be indentation of 8 characters. There should be consistency between text files and c files.
Work-around: set the printer to use the driver used by text-only printers. Then spaces and tabs seem to be preserved correctly. However, then you can't print other types of files.
What does 'rpm -q paps' say?
$ rpm -q paps
If you remove that package, do you get better or worse results?
Nothing prints, and I get the error message:
There is a missing print filter for printer 'HP-Printer'.
When I re-install the package, it again prints, but with the wrong formatting. Tab characters are still converted into a single space. Spaces seem to be preserved at this point.
This bug has been around for a while. I just got tired of having to write scripts to get around the problem.
C++ files don't use that package, so print okay with the package removed.
OK, the problem is with the paps filter then. Changing component and reassigning.
paps-0.6.8-21.fc18 has been submitted as an update for Fedora 18.
paps-0.6.8-21.fc17 has been submitted as an update for Fedora 17.
paps-0.6.8-21.fc16 has been submitted as an update for Fedora 16.
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing paps-0.6.8-21.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
paps-0.6.8-21.fc17 did not fix the issue. I updated today, tested, and left karma.
Tabs are still treated as a single blank, so the fix did not work.
The same .txt file, renamed as a .c file prints properly.
If I don't rename the .txt file, but put two slashes as the first two characters, the file prints properly.
It seems that ASCII text files should not need to use paps. They should be treated the same as .c files, or as files that have two slashes as their first two characters.
It works for me. can you attach simple test case and expected result? or if you didn't update paps-libs too, please do. if it's the case, I'm fixing it in next release.
Created attachment 616352 [details]
ASCII text makefile with some lines having a leading tab character
ASCII text with leading tab characters on some lines.
With the addition of paps-libs-0.6.8-21.fc17, the problem has been solved. Thank-you.
dunno why this bug wasn't closed even though the updated package has already been pushed to the stable. anyway closing.