Question: I can't find the way to rename files with the `enumerate` function.
Example:

```
for position, line in enumerate(pdf_text):
    lines_to_read = [1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291]
    if position in lines_to_read
        print(line,end="") 
        # I can print the text sequence at specific conditions
        pdf_file_obj.close()
        # but i've not success for use the print output as file name 
        os.rename(fullpath,+ "??" + ".pdf")

```

How can I transform the string in output to be able to use it as filename?

Answer: 
Yes, you should re-validate on the server, because you cannot control whether clients send bad information or not. Clients can send bad information either because they are evil (and/or their computer is compromised) or because they received stale information from the DB -- or the information became stale between the moment the page was generated and the moment when they made their choice.

Depending on your constraints, the DB layer may detect an invalid insert - but it is better to check beforehand, within the Spring transaction on the server that would do the important insert, that no conflicts exist.
Validating your data on the backend is very important. So you need to go ahead and validate it on the backend else your data can be easily manipulated if your logic rely on frontend validation.