PDF printer for puppy

Stuff that has yet to be sorted into a category.
Message
Author
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#61 Post by disciple »

Also, the .pdf-writer.conf that it generates automatically has the first line

Code: Select all

MRUD:.
In 2.16.1, with it like this the file selection dialogue doesn't work and all it wants to do is print as "/Created Using the fallback C locale..pdf"

If I change that line to

Code: Select all

MRUD:/
or something,
then it works fine, and once I've printed to a directory it remembers it and still works.

-----------------
If you're interested, I only just got around to testing 0.3 on Grafpup 104
BTW, in version 0.3, I change the part of the code that was giving the problem with puppy version 1.xx. You can test that and let me know how it works.
It doesn't work unless I make the same changes I had to make with the previous versions.

Version 0.6 and 0.7 never pop up the file selection dialogue, and I'm just trying to think of a way to troubleshoot it - does anyone have any idea how I can print something in a way that I get some sort of message telling me how far it got?

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#62 Post by disciple »

Actually, the first line of the config file doesn't seem to be the problem, it just doesn't work after a reboot, but manually changing that line seems to be able to fix it. Very strange.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#63 Post by jcoder24 »

In 2.16.1, with it like this the file selection dialogue doesn't work and all it wants to do is print as "/Created Using the fallback C locale..pdf"
What do you mean by "the file selection dialogue doesn't work".
Actually, the first line of the config file doesn't seem to be the problem, it just doesn't work after a reboot, but manually changing that line seems to be able to fix it. Very strange.
That IS very strange indeed. The only time the config file changes is when someone prints a file or the when it is edited manually. Rebooting should not change the file.
If I cancel a print (In 2.16.1), it prints it as "/Created Using the fallback C locale..pdf"
When u cancel, do you use the mouse or keyboard? Performing Ok/Cancel actions via the keyboard may cause gtkdialog to issue errors. Is the file that's created actually named "/Created Using the fallback C locale..pdf"? If so it looks to be part of a gtkdialog error message. If it is, I'll need to know which type so i can fix it. At present the script accommodates gtk-warning and gtk-critical, i haven't seen any others.
Version 0.6 and 0.7 never pop up the file selection dialogue
This implies a problem with gtkdialog. To troubleshoot edit /etc/cups/cupsd.conf and change the log level to debug and restart cups. Then you can run "tail -f /var/log/cups/error_log" and check for error messages or post them here for me to have a look. Also some info is logged to /var/log/messages by the pdf-writer script/backend.
If you're interested, I only just got around to testing 0.3 on Grafpup 104. It doesn't work unless I make the same changes I had to make with the previous versions.
The redirection that's giving the problem in grafpup & puppy 1.x versions (I believe) is mainly "aesthetic" and could probably be left out from the main package. I'll test it and see how much things change.

NB. I tested the 0.7 on puppy2.1.6 and wasn't able to reproduce the problems you have mentioned. Testing with new pup_save file or running from ram only and see if you get the same problem.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

Re: Version 6 works fine

#64 Post by jcoder24 »

vovchik wrote:I hope you find time to do the preferences part, since I don't know how to get my gs to print out ascii files to pdf using a nice font. They all come out outlooking pretty ugly with a courier type face. I would much prefer dejavu mono. Do you know off hand where I can change the default (e.g. a config file)?
I'll have to research this one. I have a few ideas but I'll have to see if any are possible.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#65 Post by disciple »

What do you mean by "the file selection dialogue doesn't work".
I mean that clicking on anything (with any button/scroll wheel etc) makes it disappear, and then it prints the file as "/Using the fallback C locale..pdf". It is as if clicking anything makes it think you've clicked cancel. I seem to remember seeing the same problem described before for a gtkdialog app.
That IS very strange indeed. The only time the config file changes is when someone prints a file or the when it is edited manually. Rebooting should not change the file.
It does not change the file - just for some reason the printer doesn't work after a reboot.
I confused us because when I initally installed 0.7 I hand updated the file, and it worked, then the next day (after a reboot) deleted the file to see what was automatically generated, and it then didn't work, so I changed that first line and it worked, so I assumed it was the contents of the first line that broke it, but actually it seems to be booting that breaks it - still "very strange" though.
When u cancel, do you use the mouse or keyboard?
mouse
Is the file that's created actually named "/Created Using the fallback C locale..pdf"?
no - sorry about that. The notification says "Created /Using the fallback C locale..pdf", and the file is "/Using the fallback C locale..pdf"


Thanks for the troubleshooting tips. Unfortunately I'm rather busy and it might be a while before I can do that or even test in a new 2.16 save file.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#66 Post by jcoder24 »

Everything you've mentioned seem to be indicating a gtk/Xdialog problem, most likely due to your locale. What locale do you use? Try the fix mentioned at http://www.murga-linux.com/puppy/viewto ... 698#133698 and let us know if it works.

The reason your Gtk-WARNING isn't caught by the script is because it's on the second last line returned from Xdialog. In the next version I'll do a check for the locale message and then export one that works. I'll also try to include checking all the output instead of the last line.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#67 Post by disciple »

Ah, yes. That fixed everything. Thanks.
My locale is en_NZ.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#68 Post by disciple »

Hmmm. I don't seem to have a cups log file. I wonder how I can get one?

I have this though:

Code: Select all

# tail -f /var/log/messages
Sep  6 11:24:02 (none) user.notice root: pdf-writer started: 1 root pdf on localhost - CUPS v1.1.23 1  
Sep  6 11:24:02 (none) user.notice root: pdf-writer: WARNING: /root/.Xauthority not found! Switch to console mode!
Mounting my 2.16 save file, it doesn't have a /root/.Xauthority either - strange. So I make a blank file called that and comment out those redirections in pdf-writer and add the lines at the top for the broken locale, and it works great. Except for some strange reason when it first opens the file selection dialogue, it doesn't show files in the right hand pane. If I navigate out of the directory and then back, it does show them.

This is great. It's just what I always wanted. Thanks jcoder! :) :)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#69 Post by disciple »

Instead of making /root/.Xauthority I can just comment out the lines in pdf-writer dealing with it.

The save as dialogue initially not showing files in the right-hand pane is curious. It is like that after a reboot until I print something, then when I print other things it works perfectly. If I cancel the print it still doesn't initially show files, until I have actually printed something.

Anyway - it's great.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#70 Post by jcoder24 »

disciple:

For all of you dedicated testing I've decided to upload an early version --pdf-writer 0.8rc1. This is rc1 because of the limited testing. Also I plan to rearrange the code somewhat to make it a little more efficient and to complete item 1 in the TODO list below.

Test and let me know if any issues remain. Unless anyone has feature requests I think this will be the final 'feature' update to the driver.

The remainder of the post has been merged with the following postbelow
Last edited by jcoder24 on Fri 07 Sep 2007, 00:40, edited 3 times in total.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#71 Post by disciple »

No - that doesn't seem to have fixed the locale issue. I didn't check whether it breaks after a reboot, but cancelling behaves just like the previous version :(

Feature Requests - If you were really keen you could add buttons in the notification message to open the file and to open the location of the file (I guess you could go crazy, and have buttons to email the file and a whole bunch of stuff, but these two I think would be quite useful).

I guess for compatibility the best way to do this would probably be to add settings to specify the commands to open the file manager, and the pdf viewer, and then make ROX the default for both, so the pdf will just be opened the same way as if you clicked on it in ROX.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#72 Post by jcoder24 »

Version 0.8

Changes
1) Now handles printing test pages and printing from remote machines. NB when printing a test page or remotely, the driver uses console mode and no notifications are displayed. However a log entry is added to /var/log/messages. Since 0.8 rc1, was modified so that it doesn't display file dialog when printing remotely to a puppy machine.

2) New preferences option SHARED_DIR which specifies the location of files printed remotely or via the test print option. This defaults to /shared/pdfs. If it doesn't exists it will be created when needed. Suggestions on a default folder are welcomed.

3) Now checks for "locale" error message and exports appropiate env variables for Xdialog and Xmessage to function. Fixed and tested with locale en_NZ since 0.8 rc1.

4) Checks if the os=puppylinux and ignores the missing ~/.Xauthority.

5) Cleaned up an rearrange code to make it follow more logically. This should have (hopefully) gotten rid of the bug where MRUD was updated incorrectly as experienced by disciple.


Known issues
1) Requires a hack to make it work with puppy/grafpup versions1.x.y.

TODO
1) Update documentation and convert to html
2) Update pinstall.sh script for pup/petget
3) complete install.sh (script for install on other distros)
4) Create gui (volunteers welcome)

NB TODO item #1 was to "Implement code to test all output from Xdialog instead of only the last line". This is not possible since the gtk error/warnings are always thrown (the reason why we original only checked the last line
Attachments
pdf-writer-0906-1651.tar.gz
extract with "tar xvfz pdf-writer-0906-1651.tar.gz -C /"
(2.93 KiB) Downloaded 870 times

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#73 Post by disciple »

:) It works well, except for that strange thing I'm having of initially not seeing files in the right hand pane.

So just to clarify for anyone else using it with Puppy 1.x, or if anybody trying it in another OS only gets blank pages printed: Open the pdf-writer file as text, and change these lines:

Code: Select all

        $PS2PDF $6 "$FILENAME" &> /dev/null #jcoder24 changed >& to &> and enclosed filename in ""
else
        $PS2PDF - "$FILENAME" &> /dev/null #jcoder24 changed >& to &> and enclosed filename in ""
(lines 232-234) to:

Code: Select all

        $PS2PDF $6 "$FILENAME" #&> /dev/null #jcoder24 changed >& to &> and enclosed filename in ""#commented for Grafpup104
else
        $PS2PDF - "$FILENAME" #&> /dev/null #jcoder24 changed >& to &> and enclosed filename in ""#commented for Grafpup 104
Anyone using Grafpup 1.x or a non-Puppy OS that runs only as root will also need to comment out the lines dealing with .Xauthority, or make sure they have that file in their home folder.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#74 Post by jcoder24 »

jcoder24 wrote:Version 0.8

Known issues
1) Requires a hack to make it work with puppy/grafpup versions1.x.y.

TODO
1) Update documentation and convert to html
2) Update pinstall.sh script for pup/petget
3) complete install.sh (script for install on other distros)
4) Create gui (volunteers welcome)
This the petget package for v0.8.

Updates

pdf-writer backend
1) Took the decision to update the code causing problems with puppy/grafpup version 1.x. This should not have cause any problems -- I haven't noticed any so far.

.pet package
1) Updated pinstall.sh so it checks to see if it is being called from puppy-unleashed or petget/pupget.

2) Added code to create /etc/cups/ppds/CUPS-PDF.ppd in keeping with what lpadmin does when adding a new printer.

3) Created install.sh which can be used to install the printer in other distros

4) Created documentation which is located in /usr/share/doc/pdf-writer.txt
Attachments
pdf-writer-0.8.pet
(14.14 KiB) Downloaded 872 times

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#75 Post by jcoder24 »

Version 0.9

Has two new options -- SHOW_LOCATION and FILE_MANAGER. These options give you the option to display a "Show location" location instead of just a notification. See attached images.

The first time you send job to print, pdf-writer tries to auto detect the file manager (FM). Currently it checks for the three "major ones" and rox in the following order rox, thunar (xfce), nautilus (gnome), konqueror (kde). If multiple FMs exists, the last one checked is use. ie nautilus supersedes rox and thunar. However, you can override the detected choice by specifying your preferred FM in the config.

This new option has successfully been tested on puppy and zenwalk. It works only for root with kde on pclinuxos 2007 and hasn't been test with gnome. I've tried ubuntu but just trying to get a printer installed is like trying to turn water into wine.

If someone can test with gnome and a different distro running that would be appreciated.

Some changes were made to the installation script to accommodate the ubuntu (possibly other debian) setups.

To test
1) Install with petget or via "tar xvfz pdf_writer-0.9.tar.gz -C /"
2) Remove your current config file "rm ~/.pdfwriter.conf"
3) Print any job to the CUPS-PDF printer to recreate the config file
4) Edit the config file and change SHOW_LOCATION to yes.
5) Change preferred FM if desired.

NB kde required special code to make it "kinda work", so it's possible that your preferred FM may not work out of the box.
Attachments
pdf_writer-0.9.tar.gz
Install with petget or via "tar xvfz pdf_writer-0.9.tar.gz -C /"
(3.48 KiB) Downloaded 873 times
pdf-writer2.png
"Show location" notification
(7.3 KiB) Downloaded 1462 times
pdf-writer1.png
Standard notification
(4.94 KiB) Downloaded 1462 times

User avatar
headfound
Posts: 371
Joined: Sun 25 Jun 2006, 00:58
Location: England
Contact:

#76 Post by headfound »

fantastic work! I installed my printer first time just now which was amazing, then couldn't print a pdf. But i installed your latest and it worked perfectly! Thanks.
Download a better Computer :)
[url=http://uk.youtube.com/watch?v=rDTLJYDHX3g]Puppy Linux Song[/url]
[url=http://www.letterbyletter.co.uk]www.letterbyletter.co.uk[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#77 Post by disciple »

Does anybody know why if you change the printer settings to print in black and white, it still comes out in colour? :(
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#78 Post by jcoder24 »

That's because the pdf-writer backend doesn't look at the arguments but rather uses the deafults. I've started to look at fixing that oversight.

Thanks for pointing it out.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#79 Post by disciple »

But if I go into the CUPS settings and set the printer to print in grayscale, then print something with lpr -P Cups-PDF, then I thought it should print in grayscale... am I wrong?
It doesn't anyway.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
Dingo
Posts: 1437
Joined: Tue 11 Dec 2007, 17:48
Location: somewhere at the end of rainbow...
Contact:

#80 Post by Dingo »

disciple wrote:But if I go into the CUPS settings and set the printer to print in grayscale, then print something with lpr -P Cups-PDF, then I thought it should print in grayscale... am I wrong?
It doesn't anyway.
let me reply in verse... 8)

a pretty workaround
few days ago found.
A ghostscript you need
and these instructions feed
type in console this code
for pdf grey mode:

(needs ghostscript 8.61 or upper - Muppy-Mini have bult-in)

Code: Select all

gs -sOutputFile=output.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dCompatibilityLevel=1.4 input.pdf < /dev/null
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux

Post Reply