2

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.

CODE

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

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jan 3, 2018 at 21:47

1 Answer 1

0

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

answered Jan 4, 2018 at 1:48
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.