• Модуль: documentgenerator
  • Путь к файлу: ~/bitrix/modules/documentgenerator/lib/body/docx.php
  • Класс: BitrixDocumentGeneratorBodyDocx
  • Вызов: Docx::getImage
protected function getImage($path): ?File
{
	if(!is_string($path) || empty($path))
	{
		return null;
	}
	$localPath = false;
	$fileArray = CFile::MakeFileArray($path);
	if($fileArray && $fileArray['tmp_name'])
	{
		$localPath = CBXVirtualIo::getInstance()->getLogicalName($fileArray['tmp_name']);
	}
	if($localPath)
	{
		$file = new File($localPath);
		if($this->getMimeType($file))
		{
			return $file;
		}
	}

	return null;
}