Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
document.php
1<?php
2
4
8use Bitrix\Transformer\DocumentTransformer;
9
11{
12 public static function getInputContentTypes()
13 {
14 return [
15 'text/html',
16 'text/plain',
17 'application/xml',
18 'application/pdf',
19 'application/rtf',
20 'text/rtf',
21 'application/msword',
22 'application/vnd.ms-excel',
23 'application/vnd.ms-powerpoint',
24 'application/vnd.ms-visio',
25 'application/vnd.ms-visio.drawing',
26 'application/vnd.ms-word.document.macroEnabled.12',
27 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
28 'application/vnd.ms-word.template.macroEnabled.12',
29 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
30 'application/vnd.ms-powerpoint.template.macroEnabled.12',
31 'application/vnd.openxmlformats-officedocument.presentationml.template',
32 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
33 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
34 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
35 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
36 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
37 'application/vnd.ms-excel.addin.macroEnabled.12',
38 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
39 'application/vnd.ms-excel.sheet.macroEnabled.12',
40 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
41 'application/vnd.ms-excel.template.macroEnabled.12',
42 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
43 'image/vnd.djvu',
44 'application/epub+zip',
45 'message/rfc822',
46 'application/vnd.oasis.opendocument.text',
47 ];
48 }
49
50 public function getOutputContentType()
51 {
53 }
54
55 public function getOutputExtension()
56 {
57 return 'pdf';
58 }
59
60 public function buildTransformer()
61 {
62 return new DocumentTransformer();
63 }
64
65 public function getInputMaxSize()
66 {
67 $defaultValue = ModuleManager::isModuleInstalled('bitrix24')? 40 : 10;
68
69 return intval(Option::get('main', 'max_size_for_document_transformation', $defaultValue)) * 1024 * 1024;
70 }
71}
static isModuleInstalled($moduleName)
static getByFileExtension($extension)
Definition mimetype.php:238