Thank you to @DiCaver for the solution below. I had to add the sort line as @DiCaver suggested. Works like charm. See also: Code to list PDFs in a folder in Numerical / Alphabetical order - #4 by DiCaver
```dataviewjs
const pdfFiles = app.vault.getFiles().filter(file => file.extension === 'pdf')
.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }));
dv.list(pdfFiles.map(file => dv.fileLink(file.path)))
```