PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 4.13.3
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v4.13.3
5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / ReportRenderer / Pdf.php
matomo / app / core / ReportRenderer Last commit date
Csv.php 5 years ago Html.php 4 years ago Pdf.php 3 years ago Tsv.php 5 years ago
Pdf.php
566 lines
1 <?php
2 /**
3 * Matomo - free/libre analytics platform
4 *
5 * @link https://matomo.org
6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7 *
8 */
9 namespace Piwik\ReportRenderer;
10
11 use Piwik\Common;
12 use Piwik\Filesystem;
13 use Piwik\NumberFormatter;
14 use Piwik\Piwik;
15 use Piwik\Plugins\CoreAdminHome\CustomLogo;
16 use Piwik\ReportRenderer;
17 use Piwik\TCPDF;
18 use TCPDF_FONTS;
19
20 /**
21 * @see libs/tcpdf
22 */
23 require_once PIWIK_INCLUDE_PATH . '/plugins/ScheduledReports/config/tcpdf_config.php';
24
25 /**
26 * PDF report renderer
27 */
28 class Pdf extends ReportRenderer
29 {
30 const IMAGE_GRAPH_WIDTH_LANDSCAPE = 1050;
31 const IMAGE_GRAPH_WIDTH_PORTRAIT = 760;
32 const IMAGE_GRAPH_HEIGHT = 220;
33
34 const LANDSCAPE = 'L';
35 const PORTRAIT = 'P';
36
37 const MAX_ROW_COUNT = 28;
38 const TABLE_HEADER_ROW_COUNT = 6;
39 const NO_DATA_ROW_COUNT = 6;
40 const MAX_GRAPH_REPORTS = 3;
41 const MAX_2COL_TABLE_REPORTS = 2;
42
43 const IMPORT_FONT_PATH = 'plugins/ImageGraph/fonts/unifont.ttf';
44
45 const PDF_CONTENT_TYPE = 'pdf';
46
47 private $reportFontStyle = '';
48 private $reportSimpleFontSize = 9;
49 private $reportHeaderFontSize = 16;
50 private $cellHeight = 6;
51 private $bottomMargin = 17;
52 private $reportWidthPortrait = 195;
53 private $reportWidthLandscape = 270;
54 private $minWidthLabelCell = 100;
55 private $maxColumnCountPortraitOrientation = 6;
56 private $logoWidth = 16;
57 private $logoHeight = 16;
58 private $totalWidth;
59 private $cellWidth;
60 private $labelCellWidth;
61 private $truncateAfter = 55;
62 private $leftSpacesBeforeLogo = 7;
63 private $logoImagePosition = array(10, 40);
64 private $headerTextColor;
65 private $reportTextColor;
66 private $tableHeaderBackgroundColor;
67 private $tableHeaderTextColor;
68 private $tableCellBorderColor;
69 private $tableBackgroundColor;
70 private $rowTopBottomBorder = array(231, 231, 231);
71 private $reportMetadata;
72 private $displayGraph;
73 private $evolutionGraph;
74 private $displayTable;
75 private $segment;
76 private $reportColumns;
77 private $reportRowsMetadata;
78 private $currentPage = 0;
79 private $reportFont = ReportRenderer::DEFAULT_REPORT_FONT_FAMILY;
80 private $TCPDF;
81 private $orientation = self::PORTRAIT;
82
83 public function __construct()
84 {
85 $this->TCPDF = new TCPDF();
86 $this->headerTextColor = preg_split("/,/", ReportRenderer::REPORT_TITLE_TEXT_COLOR);
87 $this->reportTextColor = preg_split("/,/", ReportRenderer::REPORT_TEXT_COLOR);
88 $this->tableHeaderBackgroundColor = preg_split("/,/", ReportRenderer::TABLE_HEADER_BG_COLOR);
89 $this->tableHeaderTextColor = preg_split("/,/", ReportRenderer::TABLE_HEADER_TEXT_COLOR);
90 $this->tableCellBorderColor = preg_split("/,/", ReportRenderer::TABLE_CELL_BORDER_COLOR);
91 $this->tableBackgroundColor = preg_split("/,/", ReportRenderer::TABLE_BG_COLOR);
92 }
93
94 public function setLocale($locale)
95 {
96 // WARNING
97 // To make Piwik release smaller, we're deleting some fonts from the Piwik build package.
98 // If you change this code below, make sure that the fonts are NOT deleted from the Piwik package:
99 // https://github.com/piwik/piwik-package/blob/master/scripts/build-package.sh
100 switch ($locale) {
101 case 'bn':
102 case 'hi':
103 $reportFont = 'freesans';
104 break;
105
106 case 'zh-tw':
107 $reportFont = 'msungstdlight';
108 break;
109
110 case 'ja':
111 $reportFont = 'kozgopromedium';
112 break;
113
114 case 'zh-cn':
115 $reportFont = 'stsongstdlight';
116 break;
117
118 case 'ko':
119 $reportFont = 'hysmyeongjostdmedium';
120 break;
121
122 case 'ar':
123 $reportFont = 'aealarabiya';
124 break;
125
126 case 'am':
127 case 'ta':
128 case 'th':
129 $reportFont = 'freeserif';
130 break;
131
132 case 'te':
133 // not working with bundled fonts
134 case 'en':
135 default:
136 $reportFont = ReportRenderer::DEFAULT_REPORT_FONT_FAMILY;
137 break;
138 }
139 // WARNING: Did you read the warning above?
140
141 // When user follow the FAQ https://matomo.org/faq/how-to-install/faq_142/, imported unifont font, it will apply across the entire report
142 if (is_file(self::IMPORT_FONT_PATH)) {
143 $reportFont = TCPDF_FONTS::addTTFfont(self::IMPORT_FONT_PATH, 'TrueTypeUnicode');
144 }
145 $this->reportFont = $reportFont;
146 }
147
148 public function sendToDisk($filename)
149 {
150 $filename = ReportRenderer::makeFilenameWithExtension($filename, self::PDF_CONTENT_TYPE);
151 $outputFilename = ReportRenderer::getOutputPath($filename);
152
153 $this->TCPDF->Output($outputFilename, 'F');
154
155 return $outputFilename;
156 }
157
158 public function sendToBrowserDownload($filename)
159 {
160 $filename = ReportRenderer::makeFilenameWithExtension($filename, self::PDF_CONTENT_TYPE);
161 $this->TCPDF->Output($filename, 'D');
162 }
163
164 public function sendToBrowserInline($filename)
165 {
166 $filename = ReportRenderer::makeFilenameWithExtension($filename, self::PDF_CONTENT_TYPE);
167 $this->TCPDF->Output($filename, 'I');
168 }
169
170 public function getRenderedReport()
171 {
172 return $this->TCPDF->Output('', 'S');
173 }
174
175 public function renderFrontPage($reportTitle, $prettyDate, $description, $reportMetadata, $segment)
176 {
177 $reportTitle = $this->formatText($reportTitle);
178 $dateRange = $this->formatText(Piwik::translate('General_DateRange') . " " . $prettyDate);
179
180 // footer
181 $this->TCPDF->SetFooterFont(array($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize));
182 $this->TCPDF->SetFooterContent((strlen($reportTitle) > 64 ? substr($reportTitle,0, 61) . "..." : $reportTitle) . " | " . $dateRange . " | ");
183
184 // add first page
185 $this->TCPDF->setPrintHeader(false);
186 $this->TCPDF->AddPage(self::PORTRAIT);
187 $this->TCPDF->AddFont($this->reportFont, '', '', false);
188 $this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize);
189 $this->TCPDF->Bookmark(Piwik::translate('ScheduledReports_FrontPage'));
190
191 // logo
192 $customLogo = new CustomLogo();
193 $this->TCPDF->Image($customLogo->getLogoUrl(true), $this->logoImagePosition[0], $this->logoImagePosition[1], 180 / $factor = 2, 0, $type = '', $link = '', $align = '', $resize = false, $dpi = 300);
194 $this->TCPDF->Ln(8);
195
196 // report title
197 $this->TCPDF->SetFont($this->reportFont, '', $this->reportHeaderFontSize + 5);
198 $this->TCPDF->SetTextColor($this->headerTextColor[0], $this->headerTextColor[1], $this->headerTextColor[2]);
199 $this->TCPDF->SetXY(10, 119);
200 $this->TCPDF->MultiCell(0, 40, $reportTitle, 0, 'L');
201
202 // date and period
203 $this->TCPDF->SetXY(10, 152);
204 $this->TCPDF->SetFont($this->reportFont, '', $this->reportHeaderFontSize);
205 $this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
206 $this->TCPDF->MultiCell(0, 40, $dateRange, 0, 'L');
207
208 // description
209 $this->TCPDF->SetXY(10, 210);
210 $this->TCPDF->Write(1, $this->formatText($description));
211
212 // segment
213 if ($segment != null) {
214 $this->TCPDF->Ln();
215 $this->TCPDF->Ln();
216 $this->TCPDF->SetFont($this->reportFont, '', $this->reportHeaderFontSize - 2);
217 $this->TCPDF->SetTextColor($this->headerTextColor[0], $this->headerTextColor[1], $this->headerTextColor[2]);
218 $this->TCPDF->Write(1, $this->formatText(Piwik::translate('ScheduledReports_CustomVisitorSegment') . ' ' . $segment['name']));
219 }
220
221 $this->TCPDF->Ln(8);
222 $this->TCPDF->SetFont($this->reportFont, '', $this->reportHeaderFontSize);
223 $this->TCPDF->Ln();
224 }
225
226 /**
227 * Generate a header of page.
228 */
229 private function paintReportHeader()
230 {
231 $isAggregateReport = !empty($this->reportMetadata['dimension']);
232
233 // Graph-only report
234 static $graphOnlyReportCount = 0;
235 $graphOnlyReport = $isAggregateReport && $this->displayGraph && !$this->displayTable;
236
237 // Table-only report
238 $tableOnlyReport = $isAggregateReport
239 && !$this->displayGraph
240 && $this->displayTable;
241
242 $columnCount = count($this->reportColumns);
243
244 // Table-only 2-column report
245 static $tableOnly2ColumnReportCount = 0;
246 $tableOnly2ColumnReport = $tableOnlyReport
247 && $columnCount == 2;
248
249 // Table-only report with more than 2 columns
250 static $tableOnlyManyColumnReportRowCount = 0;
251 $tableOnlyManyColumnReport = $tableOnlyReport
252 && $columnCount > 3;
253
254 $reportHasData = $this->reportHasData();
255
256 $rowCount = $reportHasData ? $this->report->getRowsCount() + self::TABLE_HEADER_ROW_COUNT : self::NO_DATA_ROW_COUNT;
257
258 // Only a page break before if the current report has some data
259 if ($reportHasData &&
260 // and
261 (
262 // it is the first report
263 $this->currentPage == 0
264 // or, it is a graph-only report and it is the first of a series of self::MAX_GRAPH_REPORTS
265 || ($graphOnlyReport && $graphOnlyReportCount == 0)
266 // or, it is a table-only 2-column report and it is the first of a series of self::MAX_2COL_TABLE_REPORTS
267 || ($tableOnly2ColumnReport && $tableOnly2ColumnReportCount == 0)
268 // or it is a table-only report with more than 2 columns and it is the first of its series or there isn't enough space left on the page
269 || ($tableOnlyManyColumnReport && ($tableOnlyManyColumnReportRowCount == 0 || $tableOnlyManyColumnReportRowCount + $rowCount >= self::MAX_ROW_COUNT))
270 // or it is a report with both a table and a graph
271 || !$graphOnlyReport && !$tableOnlyReport
272 )
273 ) {
274 $this->currentPage++;
275 $this->TCPDF->AddPage();
276
277 // Table-only reports with more than 2 columns are always landscape
278 if ($tableOnlyManyColumnReport) {
279 $tableOnlyManyColumnReportRowCount = 0;
280 $this->orientation = self::LANDSCAPE;
281 } else {
282 // Graph-only reports are always portrait
283 $this->orientation = $graphOnlyReport ? self::PORTRAIT : ($columnCount > $this->maxColumnCountPortraitOrientation ? self::LANDSCAPE : self::PORTRAIT);
284 }
285
286 $this->TCPDF->setPageOrientation($this->orientation, '', $this->bottomMargin);
287 }
288
289 $graphOnlyReportCount = ($graphOnlyReport && $reportHasData) ? ($graphOnlyReportCount + 1) % self::MAX_GRAPH_REPORTS : 0;
290 $tableOnly2ColumnReportCount = ($tableOnly2ColumnReport && $reportHasData) ? ($tableOnly2ColumnReportCount + 1) % self::MAX_2COL_TABLE_REPORTS : 0;
291 $tableOnlyManyColumnReportRowCount = $tableOnlyManyColumnReport ? ($tableOnlyManyColumnReportRowCount + $rowCount) : 0;
292
293 $title = $this->formatText($this->reportMetadata['name']);
294 $this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportHeaderFontSize);
295 $this->TCPDF->SetTextColor($this->headerTextColor[0], $this->headerTextColor[1], $this->headerTextColor[2]);
296 $this->TCPDF->Bookmark($title);
297 $this->TCPDF->Cell(40, 15, $title);
298 $this->TCPDF->Ln();
299 $this->TCPDF->SetFont($this->reportFont, '', $this->reportSimpleFontSize);
300 $this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
301 }
302
303 private function reportHasData()
304 {
305 return $this->report->getRowsCount() > 0;
306 }
307
308 private function setBorderColor()
309 {
310 $this->TCPDF->SetDrawColor($this->tableCellBorderColor[0], $this->tableCellBorderColor[1], $this->tableCellBorderColor[2]);
311 }
312
313 public function renderReport($processedReport)
314 {
315 $this->reportMetadata = $processedReport['metadata'];
316 $this->reportRowsMetadata = $processedReport['reportMetadata'];
317 $this->displayGraph = $processedReport['displayGraph'];
318 $this->evolutionGraph = $processedReport['evolutionGraph'];
319 $this->displayTable = $processedReport['displayTable'];
320 $this->segment = $processedReport['segment'];
321 list($this->report, $this->reportColumns) = self::processTableFormat($this->reportMetadata, $processedReport['reportData'], $processedReport['columns']);
322
323 $this->paintReportHeader();
324
325 if (!$this->reportHasData()) {
326 $this->paintMessage(Piwik::translate('CoreHome_ThereIsNoDataForThisReport'));
327 return;
328 }
329
330 if ($this->displayGraph) {
331 $this->paintGraph();
332 }
333
334 if ($this->displayGraph && $this->displayTable) {
335 $this->TCPDF->Ln(5);
336 }
337
338 if ($this->displayTable) {
339 $this->paintReportTableHeader();
340 $this->paintReportTable();
341 }
342 }
343
344 private function formatText($text)
345 {
346 return Common::unsanitizeInputValue($text);
347 }
348
349 private function paintReportTable()
350 {
351 //Color and font restoration
352 $this->TCPDF->SetFillColor($this->tableBackgroundColor[0], $this->tableBackgroundColor[1], $this->tableBackgroundColor[2]);
353 $this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
354 $this->TCPDF->SetFont('');
355
356 $fill = true;
357 $url = false;
358 $leftSpacesBeforeLogo = str_repeat(' ', $this->leftSpacesBeforeLogo);
359
360 $logoWidth = $this->logoWidth;
361 $logoHeight = $this->logoHeight;
362
363 $rowsMetadata = $this->reportRowsMetadata->getRows();
364
365 // Draw a body of report table
366 foreach ($this->report->getRows() as $rowId => $row) {
367 $rowMetrics = $row->getColumns();
368 $rowMetadata = isset($rowsMetadata[$rowId]) ? $rowsMetadata[$rowId]->getColumns() : array();
369 if (isset($rowMetadata['url'])) {
370 $url = $rowMetadata['url'];
371 }
372 foreach ($this->reportColumns as $columnId => $columnName) {
373 // Label column
374 if ($columnId == 'label') {
375 $isLogoDisplayable = isset($rowMetadata['logo']);
376 $text = '';
377 $posX = $this->TCPDF->GetX();
378 $posY = $this->TCPDF->GetY();
379 if (isset($rowMetrics[$columnId])) {
380 $text = mb_substr($rowMetrics[$columnId], 0, $this->truncateAfter);
381 if ($isLogoDisplayable) {
382 $text = $leftSpacesBeforeLogo . $text;
383 }
384 }
385 $text = $this->formatText($text);
386
387 $this->TCPDF->Cell($this->labelCellWidth, $this->cellHeight, $text, 'LR', 0, 'L', $fill, $url);
388
389 if ($isLogoDisplayable) {
390 if (isset($rowMetadata['logoWidth'])) {
391 $logoWidth = $rowMetadata['logoWidth'];
392 }
393 if (isset($rowMetadata['logoHeight'])) {
394 $logoHeight = $rowMetadata['logoHeight'];
395 }
396 $restoreY = $this->TCPDF->getY();
397 $restoreX = $this->TCPDF->getX();
398 $this->TCPDF->SetY($posY);
399 $this->TCPDF->SetX($posX);
400 $topMargin = 1.3;
401 // Country flags are not very high, force a bigger top margin
402 if ($logoHeight < 16) {
403 $topMargin = 2;
404 }
405 $path = Filesystem::getPathToPiwikRoot() . "/" . $rowMetadata['logo'];
406 if (file_exists($path)) {
407 $this->TCPDF->Image($path, $posX + ($leftMargin = 2), $posY + $topMargin, $logoWidth / 4);
408 }
409 $this->TCPDF->SetXY($restoreX, $restoreY);
410 }
411 } // metrics column
412 else {
413 // No value means 0
414 if (empty($rowMetrics[$columnId])) {
415 $rowMetrics[$columnId] = 0;
416 }
417 $this->TCPDF->Cell($this->cellWidth, $this->cellHeight, NumberFormatter::getInstance()->format($rowMetrics[$columnId]), 'LR', 0, 'L', $fill);
418 }
419 }
420
421 $this->TCPDF->Ln();
422
423 // Top/Bottom grey border for all cells
424 $this->TCPDF->SetDrawColor($this->rowTopBottomBorder[0], $this->rowTopBottomBorder[1], $this->rowTopBottomBorder[2]);
425 $this->TCPDF->Cell($this->totalWidth, 0, '', 'T');
426 $this->setBorderColor();
427 $this->TCPDF->Ln(0.2);
428
429 $fill = !$fill;
430 }
431 }
432
433 private function paintGraph()
434 {
435 $imageGraph = parent::getStaticGraph(
436 $this->reportMetadata,
437 $this->orientation == self::PORTRAIT ? self::IMAGE_GRAPH_WIDTH_PORTRAIT : self::IMAGE_GRAPH_WIDTH_LANDSCAPE,
438 self::IMAGE_GRAPH_HEIGHT,
439 $this->evolutionGraph,
440 $this->segment
441 );
442
443 $this->TCPDF->Image(
444 '@' . $imageGraph,
445 $x = '',
446 $y = '',
447 $w = 0,
448 $h = 0,
449 $type = '',
450 $link = '',
451 $align = 'N',
452 $resize = false,
453 $dpi = 72,
454 $palign = '',
455 $ismask = false,
456 $imgmask = false,
457 $order = 0,
458 $fitbox = false,
459 $hidden = false,
460 $fitonpage = true,
461 $alt = false,
462 $altimgs = array()
463 );
464
465 unset($imageGraph);
466 }
467
468 /**
469 * Draw the table header (first row)
470 */
471 private function paintReportTableHeader()
472 {
473 $initPosX = 10;
474
475 // Get the longest column name
476 $longestColumnName = '';
477 foreach ($this->reportColumns as $columnName) {
478 if (strlen($columnName) > strlen($longestColumnName)) {
479 $longestColumnName = $columnName;
480 }
481 }
482
483 $columnsCount = count($this->reportColumns);
484 // Computes available column width
485 if ($this->orientation == self::PORTRAIT
486 && $columnsCount <= 3
487 ) {
488 $totalWidth = $this->reportWidthPortrait * 2 / 3;
489 } elseif ($this->orientation == self::LANDSCAPE) {
490 $totalWidth = $this->reportWidthLandscape;
491 } else {
492 $totalWidth = $this->reportWidthPortrait;
493 }
494 $this->totalWidth = $totalWidth;
495 $this->labelCellWidth = max(round(($this->totalWidth / $columnsCount)), $this->minWidthLabelCell);
496 $this->cellWidth = round(($this->totalWidth - $this->labelCellWidth) / ($columnsCount - 1));
497 $this->totalWidth = $this->labelCellWidth + ($columnsCount - 1) * $this->cellWidth;
498
499 $this->TCPDF->SetFillColor($this->tableHeaderBackgroundColor[0], $this->tableHeaderBackgroundColor[1], $this->tableHeaderBackgroundColor[2]);
500 $this->TCPDF->SetTextColor($this->tableHeaderTextColor[0], $this->tableHeaderTextColor[1], $this->tableHeaderTextColor[2]);
501 $this->TCPDF->SetLineWidth(.3);
502 $this->setBorderColor();
503 $this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle);
504 $this->TCPDF->SetFillColor(255);
505 $this->TCPDF->SetTextColor($this->tableHeaderBackgroundColor[0], $this->tableHeaderBackgroundColor[1], $this->tableHeaderBackgroundColor[2]);
506 $this->TCPDF->SetDrawColor(255);
507
508 $posY = $this->TCPDF->GetY();
509 $this->TCPDF->MultiCell($this->cellWidth, $this->cellHeight, $longestColumnName, 1, 'C', true);
510 $maxCellHeight = $this->TCPDF->GetY() - $posY;
511
512 $this->TCPDF->SetFillColor($this->tableHeaderBackgroundColor[0], $this->tableHeaderBackgroundColor[1], $this->tableHeaderBackgroundColor[2]);
513 $this->TCPDF->SetTextColor($this->tableHeaderTextColor[0], $this->tableHeaderTextColor[1], $this->tableHeaderTextColor[2]);
514 $this->TCPDF->SetDrawColor($this->tableCellBorderColor[0], $this->tableCellBorderColor[1], $this->tableCellBorderColor[2]);
515
516 $this->TCPDF->SetXY($initPosX, $posY);
517
518 $countColumns = 0;
519 $posX = $initPosX;
520 foreach ($this->reportColumns as $columnName) {
521 $columnName = $this->formatText($columnName);
522
523 //Label column
524 if ($countColumns == 0) {
525 $this->TCPDF->MultiCell($this->labelCellWidth, $maxCellHeight, $columnName, $border = 0, $align = 'L', true);
526 $this->TCPDF->SetXY($posX + $this->labelCellWidth, $posY);
527 } else {
528 $this->TCPDF->MultiCell($this->cellWidth, $maxCellHeight, $columnName, $border = 0, $align = 'L', true);
529 $this->TCPDF->SetXY($posX + $this->cellWidth, $posY);
530 }
531 $countColumns++;
532 $posX = $this->TCPDF->GetX();
533 }
534 $this->TCPDF->Ln();
535 $this->TCPDF->SetXY($initPosX, $posY + $maxCellHeight);
536 }
537
538 /**
539 * Prints a message
540 *
541 * @param string $message
542 * @return void
543 */
544 private function paintMessage($message)
545 {
546 $this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize);
547 $this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
548 $message = $this->formatText($message);
549 $this->TCPDF->Write("1em", $message);
550 $this->TCPDF->Ln();
551 }
552
553 /**
554 * Get report attachments, ex. graph images
555 *
556 * @param $report
557 * @param $processedReports
558 * @param $prettyDate
559 * @return array
560 */
561 public function getAttachments($report, $processedReports, $prettyDate)
562 {
563 return array();
564 }
565 }
566