Results 1 to 4 of 4

Thread: cups-pdf and "save as" dialog window

  1. #1
    Join Date
    Aug 2009
    Location
    Buenos Aires, Argentina
    Posts
    95

    Default cups-pdf and "save as" dialog window

    I needed to print to pdf files so I installed cups-pdf. But after printing I realized the printer would only save to a certain path and filename. I've found possible solution using the Postproccesing option. It works ok with a bash script but I like to be asked for a folder and filename instead of using a default one.

    So i using kdialog I managed to get it working like this

    Code:
    #!/bin/bash
    
    export DISPLAY=:0.0
    export XAUTHORITY=/home/$2/.Xauthority
    
    origen=$1
    #archivo has the date and hour so no pdf would be overwritten by mistake
    archivo=`date +%Y%m%d-%H%M%S`.pdf 
    destino=`kdialog --title "Guardar documento como" --getsavefilename "/home/$2/Documentos/$archivo" "*.pdf |Archivos PDF"`
    
    mv $origen $destino
    Just call this script from your /etc/cups/cups-pdf.conf in the Postproccesing line

    ...
    Postprocessing absolute_path_to_your_script
    ...

    Hope this helps,

    Pancho
    openSUSE | Think correctly

  2. #2
    Join Date
    Jun 2008
    Location
    Delta Quadrant
    Posts
    1,442

    Default Re: cups-pdf and "save as" dialog window

    Very nice. Will have to give it a test.
    I use cups-pdf as a network printer, but would also like to
    use it sometimes locally. This would be a handy addition.



  3. #3
    Join Date
    Aug 2009
    Location
    Buenos Aires, Argentina
    Posts
    95

    Default Re: cups-pdf and "save as" dialog window

    As an update I can say that the pdf documents generated by default with cups-pdf were not editable by Libre Office Draw 3.4.2. But if you change the converter in /etc/cups/cups-pdf.conf with the ps2pdf (or pstopdf) converter they will be editable. The problem seems to be with the font embedding.
    openSUSE | Think correctly

  4. #4
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,937

    Default Re: cups-pdf and "save as" dialog window

    I use cups-pdf mainly to print from bricscad to landscape large-format pdfs. Not being as savvy with the command line, I just made a link under my work directory to /var/spool/cups-pdf/<myusername>, so I can access/rename the pdfs more easily. However there is the issue of the filename. Two prints of the same drawing get the same name (Bricscad-<cadfilename>-Model in this case), and the second will overwrite the first without warning. This is something your script would fix, perhaps in my case without the save dialog (as the pdf is already where I want it).

    For most other PDF printing (portrait A4/letter size) I use KDE's facility print-to-ps/pdf in the print dialog, where I can set the path.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •