Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
pdf.php
1
<?php
2
3
namespace
Bitrix\Main\UI\Viewer\Renderer
;
4
5
class
Pdf
extends
Renderer
6
{
7
const
WIDTH
= 900;
8
const
HEIGHT
= 800;
9
10
const
JS_TYPE_DOCUMENT
=
'document'
;
11
12
public
function
getWidth
()
13
{
14
return
$this->
getOption
(
'width'
, self::WIDTH);
15
}
16
17
public
function
getHeight
()
18
{
19
return
$this->
getOption
(
'height'
, self::HEIGHT);
20
}
21
22
public
static
function
getJsType
()
23
{
24
return
self::JS_TYPE_DOCUMENT
;
25
}
26
27
public
static
function
getAllowedContentTypes
()
28
{
29
return
[
30
'application/pdf'
,
31
];
32
}
33
34
public
function
render
()
35
{
36
global $APPLICATION;
37
ob_start();
38
$APPLICATION->IncludeComponent(
39
'bitrix:pdf.viewer'
,
40
''
,
41
[
42
'TITLE'
=> $this->name,
43
'PATH'
=> $this->sourceUri,
44
'HEIGHT'
=> $this->
getHeight
(),
45
'WIDTH'
=> $this->
getWidth
(),
46
'sizeType'
=> $this->
getOption
(
'sizeType'
,
'absolute'
),
47
]
48
);
49
50
return
ob_get_clean();
51
}
52
53
public
function
getData
()
54
{
55
return
[
56
'src'
=>
$this->sourceUri
,
57
];
58
}
59
}
Bitrix\Main\UI\Viewer\Renderer\Pdf
Definition
pdf.php:6
Bitrix\Main\UI\Viewer\Renderer\Pdf\HEIGHT
const HEIGHT
Definition
pdf.php:8
Bitrix\Main\UI\Viewer\Renderer\Pdf\JS_TYPE_DOCUMENT
const JS_TYPE_DOCUMENT
Definition
pdf.php:10
Bitrix\Main\UI\Viewer\Renderer\Pdf\getAllowedContentTypes
static getAllowedContentTypes()
Definition
pdf.php:27
Bitrix\Main\UI\Viewer\Renderer\Pdf\getData
getData()
Definition
pdf.php:53
Bitrix\Main\UI\Viewer\Renderer\Pdf\WIDTH
const WIDTH
Definition
pdf.php:7
Bitrix\Main\UI\Viewer\Renderer\Pdf\getJsType
static getJsType()
Definition
pdf.php:22
Bitrix\Main\UI\Viewer\Renderer\Pdf\getHeight
getHeight()
Definition
pdf.php:17
Bitrix\Main\UI\Viewer\Renderer\Pdf\getWidth
getWidth()
Definition
pdf.php:12
Bitrix\Main\UI\Viewer\Renderer\Pdf\render
render()
Definition
pdf.php:34
Bitrix\Main\UI\Viewer\Renderer\Renderer
Definition
renderer.php:9
Bitrix\Main\UI\Viewer\Renderer\Renderer\$sourceUri
$sourceUri
Definition
renderer.php:14
Bitrix\Main\UI\Viewer\Renderer\Renderer\getOption
getOption($name, $defaultValue=null)
Definition
renderer.php:25
Bitrix\Main\UI\Viewer\Renderer
Definition
audio.php:3
modules
main
lib
ui
viewer
renderer
pdf.php
Создано системой
1.10.0