/
Engine.php
77 lines (65 loc) · 1.73 KB
/
Engine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/*
* Copyright 2011 Piotr Śliwa <peter.pl7@gmail.com>
*
* License information is in LICENSE file
*/
namespace PHPPdf\Core\Engine;
use PHPPdf\Core\UnitConverter;
/**
* Engine is an Abstract Factory for objects related with graphics engine type
*
* @author Piotr Śliwa <peter.pl7@gmail.com>
*/
interface Engine extends UnitConverter
{
/**
* Creates and returns GraphicsContext.
*
* Returned graphics context isn't attached to engine,
* {@see attachGraphicsContext()} have to been invoked.
*
* @return GraphicsContext
*/
public function createGraphicsContext($graphicsContextSize, $encoding);
/**
* Creates and returns Image object depends on image data
*
* @return Image
*/
public function createImage($imageData);
/**
* Creates and returns Font object depends on font data
*
* @return Font
*/
public function createFont($fontData);
/**
* Attachs GraphicsContext to engine
*/
public function attachGraphicsContext(GraphicsContext $gc);
/**
* @return array All of attached graphics contexts
*/
public function getAttachedGraphicsContexts();
/**
* Renders document
*
* @return string String representation of the document
*/
public function render();
/**
* Loads Engine object from given Pdf document
*
* @return Engine
*/
public function loadEngine($file, $encoding);
/**
* Sets single metadata value for document
*
* @param string $name Name of metadata
* @param mixed $value Value of metadata
*/
public function setMetadataValue($name, $value);
public function reset();
}