[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-08-15 Thread Till Kamppeter
** Changed in: cups-pdf (Ubuntu)
   Status: Fix Committed => Fix Released

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://bugs.launchpad.net/bugs/82674
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-08-14 Thread Till Kamppeter
I have attached a debdiff of my changes now. This should help you to add
the changes to the Debian package.


** Attachment added: "debdiff of my changes"
   
http://launchpadlibrarian.net/8831177/cups-pdf_2.4.6-3ubuntu1_2.4.6-3ubuntu2.debdiff

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://bugs.launchpad.net/bugs/82674
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-08-14 Thread Martin-Éric Racine
I'd appreciate the diff being submitted directly to Debian to avoid
pointless forks and instead make everyone benefit from it. Thanks!

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://bugs.launchpad.net/bugs/82674
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-08-14 Thread Till Kamppeter
Packages for testing are here:

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/cups-pdf/

Will soon appear in Gutsy.

** Changed in: cups-pdf (Ubuntu)
 Assignee: Martin-Éric Racine => Till Kamppeter
   Status: Confirmed => Fix Committed

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://bugs.launchpad.net/bugs/82674
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-06-12 Thread Martin-Éric Racine
Note that CUPS-PDF 2.4.6-1 (Gutsy) already performs a fair dose of auto-
detection. Adding the printer is now only a two-click process. Not quite
the fully automated installation, but almost.

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://bugs.launchpad.net/bugs/82674
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-09 Thread Martin-Éric Racine
** Changed in: cups-pdf (Ubuntu)
 Assignee: (unassigned) => Martin-Éric Racine

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Till Kamppeter
Note that with "-m" in the "lpadmin" you have to give the PPD path
exactly as shown in the output of "lpinfo -m". If you want to give an
absolute path, use "-P" (uppercase P) instead.

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Till Kamppeter
Steps for Post-install:

Check whether there is already a CUPS-PDF queue with "LC_ALL=C lpstat -v
| grep 'cups-pdf:/'". If so, assign the name of the first queue found to
$queue and skip the next paragraph.

Assign "PDF" to the variable $queue, then start a "while" loop checking
"LC_ALL=C lpstat -v | cut -d ':' -f 1 | cut -d ' ' -f 3 | grep
^$queue\$" and exit the "while" loop if it fails. In the while loop
asign a new name to $queue: PDF, PDF1, PDF2, ... Then create the queue
with queue name $queue.

Then check with "LC_ALL=C lpstat -d | grep 'system default
destination:'" whether there is already a default printer. If not, set
the PDF printer as default with "lpadmin -d $queue".

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Martin-Éric Racine
The script magic you propose for prerm should work well as-is.

For postinst, what I would use:

lpadmin -p PDF -E -v cups-pdf:/ -m PostscriptColor.ppd -o
PageSize=$(paperconf) -o printer-is-shared=no

paperconf(1) from libpaper-utils (added to Depends) tells us the default
paper size.

What I need before that is a way to check:

1) Is there already a printer called PDF? if there is, add a digit to
the printer name we're about to create.

2) Is there any default printer already? If there is, don't set as
default.

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Till Kamppeter
Detecting all cups-pdf devices is easy, to take down all these queues
simply do

for q in `LC_ALL=C lpstat -v | grep 'cups-pdf:/' | cut -d ':' -f 1 | cut -d ' ' 
-f 3`; do
   lpadmin -x $q
done

For setting the PDF printer as default check at first whether there is
already a default printer with "LC_ALL=C lpstat -d | grep 'system
default destination:'" and set PDF as the default printer only if there
is no default printer yet.

You do not restart CUPS when adding or removing printers with the
"lpadmin" command.

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Till Kamppeter
Such a PDF printer makes only sense one the local machine, where the
printer queue is defined, therefore CUPS should be advised to no
broadcast it into the network. This is done by adding "-o printer-is-
shared=no" to the "lpadmin" command:

lpadmin -p PDF -E -v cups-pdf:/ -m foomatic:Generic-PostScript_Printer-
Postscript.ppd -o PageSize= -o
printer-is-shared=no

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Martin-Éric Racine
Till, thanks for your overview of the situation.

CUPS-PDF already provides a generic PostScript PPD which upstream and I
heavily edited to include only the bare minimum.

We could indeed create a printer called PDF at installation time and
delete it at removal time, then restart CUPS to refresh the available
printer list.

Detecting all existing CUPS-PDF devices at installation and removal is
slightly more tricky and would require a heavy dose of scripting magic.
Patches are welcome.

Making CUPS-PDF the default CUPS printer could be done, but might
confuse users who have real printers attached to their computer and make
them wonder why printouts are not coming out of their printer by
default.

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82674] Re: add/remove the PDF printer in CUPS at installation/removal time

2007-02-02 Thread Till Kamppeter
There should be a special print queue for generating PDF files. Sending
a job to this queue should generate a PDF file from the document sent
into the queue. The PDF file should be easily accessible for the sender
of the job, but other users should not be able to read it.

The package cups-pdf provides the special CUPS backend which converts
incoming PostScript to PDF and puts the resulting PDF into the right
place.

To make this grandmother-proof, the installation of the package should
prepare everything to use this feature. Especially the mentioned print
queue is needed. As the package does not make sense without the print
queue and the print queue does not make sense without the package, the
queue should be created when the package finishes to be installed
(postinstall) and the queue should be removed when the package starts to
be uninstalled (prerm).

Creating and taking down the queue in the postinstall and prerm scripts
is easy. To create it do

lpadmin -p PDF -E -v cups-pdf:/ -m foomatic:Generic-PostScript_Printer-
Postscript.ppd -o PageSize=A4

and to take it down

lpadmin -x PDF

This should be somewhat refined, once when creating the queue it should
be checked whether the queue name already exists and if so, another
queue name should be used (PDF1, PDF2, ...). If there is already a queue
with a "cups-pdf:/" URI, no queue shoud be created.

On uninstallation of the package all queues with "cups-pdf:/" URIs
should be taken down.

A script can also easily find out which local queues already exist and
which URI they have:

lpstat -v | grep -v 'ipp://'

It should also be checked whether a default printer or class is set
("lpstat -d") and if not, the new PDF queue should be made the default.

Concerning the user's choice of the PPD file, he can always change it
with any printer setup tool. More important is grandmother-proofness and
this one reaches only by using a default PPD file.

The PPD file needed is one for a generic PostScript printer. Best is one
which has no tray and duplex options (there is no printer), no
resolution (both PostScript and PDF are vector formats and there is no
raster-based printing engine). It should have only things like color/bw,
quality vs. size, ... (see what options you can set when choosing
"Export to PDF" in OpenOffice.org).


** Changed in: cups-pdf (Ubuntu)
   Importance: Undecided => Medium
   Status: Unconfirmed => Confirmed

-- 
add/remove the PDF printer in CUPS at installation/removal time
https://launchpad.net/bugs/82674

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs