I'm looking to specify the file extension of the output file created by running my script from the processing toolbox. Currently, the user must type in the extension in themselves, which I would like to avoid if possible. Ideally, there would be a drop-down, and among the options I would like to have the .pdf extension type.

  • My goal is to increase the usability of the script. It's not a major issue to have the user type in .some extension manually for their file output, but I believe a drop-down would be easier to use than having to type in a file extension each time.


To create the output option where the user has to choose a path for their output file, I use the following code in the script:

##PDF_file=output file

This code works as long as the user specifies and manually types in the .pdf extension illustrated below.

Choosing output file location

enter image description here

1 Answer 1


If you are using QGIS 2.18 (doesn't work in 2.14, untested in 2.16) you can use:

##PDF_file=output file pdf

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.