Well, I could finally solve the problem.
When adding code immediately after starting the "doc" object, everything works fine.
$this->doc = t3lib_div::makeInstance('mediumDoc'); $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('myExt') . 'res/css/my_stylesheet.css');
source share