Announcement

Collapse
No announcement yet.

How-To: Choose Custom Location and Filename with CUPS-PDF

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How-To: Choose Custom Location and Filename with CUPS-PDF

    How-To: Choose Custom Location and Filename with CUPS-PDF
    by: T. Zinni 13 April 2008

    This example will provide information on how to print a PDF document from an application (such as Firefox) that allows you to select a custom filename and file location without modifying the cups configuration file.

    1. Select "Print" from the "File" menu.

    2. Once the dialog opens, choose "Print to File" as your printer.

    3. Click the "PDF" radio button next to "Output Format" and the default file extension will automatically change to .pdf in the "Name" box.

    4. In the "Name" box, rename the file to whatever you like in the text box + .pdf (e.g., mynewfile.pdf).

    5. Click the "Save in Folder" dropdown and select the location you want to save the file to on your system. Note that Network locations may not be available.

    6. Choose any other options you prefer.

    7. Select "Print".

    Finished.

    The process was similar for AbiWord 2.4.6 but in OOWriter 2.4, be sure to check the "Print to File" checkbox and type the full name of the filename with the .pdf extension. Set the file type to "All". OOCalc 2.4 did not work until the spreadsheet was saved first.

    #2
    Re: How-To: Choose Custom Location and Filename with CUPS-PDF

    Thanks. Very clear and very helpful. I couldn't find anything on this topic anywhere else.

    Comment


      #3
      Re: How-To: Choose Custom Location and Filename with CUPS-PDF

      create a script /usr/bin/cupscript.sh with the following entry
      #!/bin/bash
      CURRENT_PDF="${1}"
      CURRENT_USER="${2}"
      DISPLAY=:0.0
      export DISPLAY
      XAUTHORITY=/home/${CURRENT_USER}/.Xauthority
      export XAUTHORITY
      PDFNAME=$(zenity --file-selection --save --confirm-overwrite)
      mv "$CURRENT_PDF" "$PDFNAME"
      and save the file.
      Now open the file /etc/apparmor.d/usr.sbin.cupsd and add the above script path (only the path, not the file name) followed by "uxr" and before the closing braces "}" as shown in the example below
      /usr/bin/cupscript.sh uxr,
      Now open the file /etc/cups/cups-pdf.conf, uncomment Postprocessing and replace with the following as shown below
      PostProcessing /usr/bin/cupscript.sh
      save the line and exit.
      Restart apparmor and cups using the command
      sudo /etc/init.d/apparmor reload
      sudo service cups restart
      That's it done..
      vinodh kumar sampath

      Comment

      Working...
      X