PDF printer for puppy

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#31 Post by jcoder24 »

disciple wrote:I think it might be better for a print job to be deleted if you press cancel, than for it to stay in the queue and the printer to go off line. I think the current behaviour would be confusing to most users.
This is taken care of by this piece of code.

Code: Select all

#if user choses not to save file, exit gracefully 
if [ -z "$FILENAME" ]; then 
        logger "pdf-writer: INFO: JOB $JOB aborted by $USER!" 
        exit 0 
fi
exit 0 tells cups that everything was completed successfully. During testing, (before I posted the script) I saw the problem and plugged it with that code. However, what I've since noticed is that if you enter a filename and hit enter instead of clicking ok, Xdialog segfaults producing the symptoms you have described. This too may be happening when you hit esc. I've added a check to abort the print if ok/cancel is not clicked.
disciple wrote:Also, it would be handy to have a printer option to turn off the feature to add a date to prevent overwriting a file
I have modifed the printer so that if the file exists it ask you if you want to overwrite with a yes or no option. If the answer no, display they dialog again.
disciple wrote:Printing from Firefox or Seamonkey I also have to specify the same size when I go to print it, otherwise it scales to the size specified by the browser, but puts it on the size paper specified by CUPS. How annoying. Why can't the browser dictate the paper size?
In Seamonkey/Firefox I can change the paper size by clicking the properties button next to the printer name. Unfortunately all programs don't have this option eg geany.

Thanks for all of your testing disciple
Attachments
cupspdf-0.2.pet
(2.1 KiB) Downloaded 927 times

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

#32 Post by disciple »

-
Last edited by disciple on Thu 19 Jul 2007, 05:03, edited 1 time in total.

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

#33 Post by disciple »

--I'm testing the latest version, in a fresh 2.16.1 frugal install, with just the CUPS dotpup, XPDF and GTKLP installed--

The new overwrite behaviour is suberb. Thanks :)
This is taken care of by this piece of code.
On my system it isn't. If I press cancel when asked where to save it, the job stays in the queue and the printer gets stopped. The same thing happens if I press X to close the window - or do you mean that this code makes it behave like this, rather than preventing it? It would be much more user-friendly if somehow the job could just be deleted and the printer stay online.
Pressing enter instead of clicking OK works fine.

Apart from that it is absolutely great, and I can't get it to break or anything.
The only other enhancement I can think of is to not let a user click OK without putting in a name, but I don't know if this is even possible. At the moment if you are in /root/my-documents, it will make /root/my-documents.pdf, which is a little confusing.

-----------
Just because I like to document everything: If /usr/lib/cups/backend/pdf-writer gets deleted then you get the symptoms I reported before, where jobs will queue, but you never get asked where to save it. If you uninstall the .pet, then this will be deleted, but the printer will still appear to be on the system. (This is not why I initially had the problem, as that was before the .pet :))

-----------
Printing from browsers etc - that's interesting if it works for you - for me the printer properties from Seamonkey/Firefox scale what is printed, but don't actually change the papersize. Changing the page size from Openoffice just prints it at the size set by CUPS. I don't think it has anything to do with the PDF printer, I was just commenting on it. Another funny thing is that when you print from Seamonkey or Firefox, while it is preparing to print it has a window with a cancel button that doesn't actually cancel anything :)

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

#34 Post by jcoder24 »

Barry,
lpadmin adds these lines to /etc/cups/printers.conf if its the first printer to be installed.

Code: Select all

<DefaultPrinter CUPS-PDF>
Info CUPS-PDF
DeviceURI pdf-writer:/export/share/pdf/
State Idle
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
If not, then the first line becomes

Code: Select all

<Printer CUPS-PDF>
You should be able to just add those lines to /etc/cups/printers.conf to simiulate running lpadmin when creating the live-cd.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#35 Post by BarryK »

jcoder24, thanks for that info, yes, that would be an improvement.
I "froze" 2.17 last night, and won't make any further changes, even one as small as this. The way I did it is less efficient but works, and I have written down your improved method to be implemented for the next Puppy.

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

HP Drivers PET

#36 Post by nic2109 »

In Barry's 2.17 Release Notes he mentions that the HPIJS drivers were moved to a seperate PET. The forum also suggests that this should be installed prior to running CUPS.

Can someone direct me to the PET as I cannot see it in the list of "Official PETs"? Thanks.

And also, IS there a preferred sequence for the installattion?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: HP Drivers PET

#37 Post by BarryK »

nic2109 wrote:Can someone direct me to the PET as I cannot see it in the list of "Official PETs"? Thanks.

And also, IS there a preferred sequence for the installattion?
Yes it is, I just checked. Click the 'install' button on the desktop, then follow your nose from there, and there it is in the left pane.

Install the hpijs package, then choose Setup --> CUPS printer wizard.

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

#38 Post by disciple »

Oh. In my Grafpup install if I click cancel the job is cancelled and the printer is not stopped, so it is just my install of 2.16 that has problems. Oh well.

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

Re: HP Drivers PET

#39 Post by nic2109 »

BarryK wrote:
nic2109 wrote:Can someone direct me to the PET as I cannot see it in the list of "Official PETs"? Thanks.

And also, IS there a preferred sequence for the installattion?
Yes it is, I just checked. Click the 'install' button on the desktop, then follow your nose from there, and there it is in the left pane.

Install the hpijs package, then choose Setup --> CUPS printer wizard.
Er...... this is odd since it's not there for me. Is there something to do first to refresh the list of packages?

I tried MU's PSI and there it is, but that does have a "Do you want to refresh the list?" dialogue first.

As usual with new/nervous users my assumption is that I have done something wrong (or failed to do something right) but what might that be?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: HP Drivers PET

#40 Post by BarryK »

nic2109 wrote:
BarryK wrote:
nic2109 wrote:Can someone direct me to the PET as I cannot see it in the list of "Official PETs"? Thanks.

And also, IS there a preferred sequence for the installattion?
Yes it is, I just checked. Click the 'install' button on the desktop, then follow your nose from there, and there it is in the left pane.

Install the hpijs package, then choose Setup --> CUPS printer wizard.
Er...... this is odd since it's not there for me. Is there something to do first to refresh the list of packages?

I tried MU's PSI and there it is, but that does have a "Do you want to refresh the list?" dialogue first.

As usual with new/nervous users my assumption is that I have done something wrong (or failed to do something right) but what might that be?
hpijs is in the list if you are running 2.17. If not, you will have to go to ibiblio and download the hpijs PET package, then just click on it -- well, just clicking on it in the ibiblio site, seamonkey will offer to download or install it directly.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#41 Post by MU »

"Do you want to refresh the list?
You mean the initial question when you start PSI?
If the hp package is not listed, then you must confirm to refresh the list.
I run a serverside script maybe once a month to get the current list of Barrys packages in PSI.
I just updated it yesterday.
To see the latest packages, you must confirm to refresh the list.

PSI offers this question, because all those lists are quite huge, and might take some minutes to download on a dialup-connection (with ADSL it takes only some seconds).
Mark

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

CUPS and HPIJS

#42 Post by nic2109 »

Barry K wrote : hpijs is in the list if you are running 2.17.
I thought that was what I was running, but clearly not as booting afresh with pfix=ram gives a different list of packages - including hpijs!

So, the screw-up fairy has visited me again and I've fouled up my installation. As that's a different topic I'll create a new thread in a more appropriate area.

Thanks for the responses everyone.

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

#43 Post by jcoder24 »

Version 0.3

Bug fixes
1) Fixed a minor bug (introduced in version 0.2) where if you canceled a job it still saved it as the hidden file /root/.pdf

Changes
1) pinstall.sh now adds the printer directly to /etc/cups/printers.conf instead of using lpadmin. This should work for both puppy-unleashed and petget.

New features
1) Remembers last directory used (via config file $HOME/cupspdf.conf).
2) Supply the filename presented to CUPS (if any) as the default filename. For apps that send jobs with filename 'stdin', no default filename is supplied. NB the filename used has all spaces converted to underscores and all other non-alphanumeric characters are dropped. If I can figure out how it get it to generate a file name with spaces that would be added to a future version.
Attachments
cupspdf-0.3.pet
(2.69 KiB) Downloaded 840 times

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

#44 Post by disciple »

:D It just keeps getting better.

This one's even better and my 2.16 is fixed now. It would be superb if you could handle the spaces, as again that could get people confused, as you get the same behaviour as before - the printer is "turned off", but also it resets the last directory to /

Even if it just refused to accept filenames with spaces it would be better.

Are you sure the configuration file shouldn't be a hidden file?

----------
It's funny how easy it is to miss bugs like that one - I didn't even notice it until just before you fixed it.

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

#45 Post by jcoder24 »

Thanks for reminding me about the spaces (i've just fixed it in the new version). Below is a list of what's different in version 0.4. 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. Just extract the files from the .pet as if it were a tar.gz and copy over to the 1.xx version.

New features
1) Print job completion notification via (config file)
2) Run in a console-only setup (via config file)

Changes
1) Config file is now a hidden file
2) Reorganized code to better accommodate console only option

Sanity check
3) Remove any invalid characters in the filename entered by the user

I have some more testing to do then I'll upload the update. I think this is getting to a stage where I'll have to put together a feature list and a small manual for this package and maybe a configuration gui.

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

#46 Post by nic2109 »

This is all fine and dandy, but I cannot print the PDF once created as epdfview gives a "Segmentation fault" and crashes out.

See forum thread http://www.murga-linux.com/puppy/viewtopic.php?t=20377.

I'm on 217 with the hpijs drivers package.

It's got me foxed - and BarryK too possibly. Any ideas anyone?

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

#47 Post by disciple »

That doesn't seem to be anything to do with CUPS-pdf, but anyway - you might have to try a different pdf reader like Xpdf or something if you need to print while it isn't fixed.

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

#48 Post by nic2109 »

disciple wrote:That doesn't seem to be anything to do with CUPS-pdf, but anyway - you might have to try a different pdf reader like Xpdf or something if you need to print while it isn't fixed.
I'm willing to try this, so how should I go about downloading and installing xpdf?

I cannot see it as either a PET or a DotPup package, while the website has scary comments about compiling and making and so on which make me want to run away (bravely).

Nick

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

#49 Post by disciple »

There are links to three versions at http://www.murga-linux.com/puppy/viewtopic.php?t=8727
Colonel Panic recommends Adobe Reader 5, but it was very troublesome for me and other people too.

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

#50 Post by disciple »

Also, if you install GTKLP, it can print pdf files - but only the whole file - not certain pages.

http://www.murga-linux.com/puppy/viewto ... 03&t=17768

EDIT - it can print a selection of pages from a file - there is a space for extra options on the special tab. I've described some of them at http://puppylinux.org/wikka/Printing.
Last edited by disciple on Thu 06 Sep 2007, 05:35, edited 1 time in total.

Post Reply