Something like this will do it:
'components' => [
'file::url' => function (Kirby $kirby, $file) {
$page = $file->parent();
if ($file->extension() == 'pdf') {
return $kirby->url() . '/content/' . $page->diruri() . '/' . $file->filename();
} else {
return $file->mediaurl();
}
}
]
Will serve PDF files directly from the content folder, whilst allowing normal behaviour for other file types. Tweak the condition accordingly.