Here is an AHK script that should do it for you. This assumes you have 1 directory with many .pdf files in it, it will loop through getting each file name and create a new directory(within the main/root directory) with the current file name then move the file in to the new directory with the matching name.
*I have tested, but you should always have a backup or copy of the directory you're working on before using this script*#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines -1
FileSelectFolder, Root, , , Select Root Folder
If ErrorLevel = 1
Reload
Loop, %Root%\*.pdf
{
StringTrimRight, Folder, A_LoopFileName, 4
FileCreateDir, %Root%\%Folder%
FileMove, %A_LoopFileFullPath%, %Root%\%Folder%\%A_LoopFileName%
}
ExitApp