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


#!/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

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.

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.

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.