When saving pdf files, spaces are replaced by "% 20" (without the quotation marks)

0

I'm using interop to create a word document and in the end save it to PDF, everything happens fine except for the file name, and I used this path to save it.

var NovoDocumento = "C:/Users/Bird/Desktop/PTD´S/" + tbNomeProf.Text + " - " + tbMateria.Text  + ".pdf";

Everything is fine except that spaces are replaced by% 20

The filename was supposed to be as follows

Leandro Ferro -  Sistema de Tratamento de Água e Resíduos.pdf

But it's coming out like this

Leandro%20Ferro%20-%20%20Sistema%20de%20Tratamento%20de%20Água%20e%20Resíduos.pdf
    
asked by anonymous 09.01.2018 / 02:03

1 answer

-1

Try to put a double quotation mark like this:

var NovoDocumento = "C:/Users/Bird/Desktop/PTD´S/"" + tbNomeProf.Text + " - "" + tbMateria.Text  + ".pdf";

source: link

    
09.01.2018 / 02:44