aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 9cde27c6..1debdf8e 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -300,14 +300,6 @@ class EntriesExport
300 $pdf->SetKeywords('wallabag'); 300 $pdf->SetKeywords('wallabag');
301 301
302 /* 302 /*
303 * Front page
304 */
305 $pdf->AddPage();
306 $intro = '<h1>' . $this->title . '</h1>' . $this->getExportInformation('tcpdf');
307
308 $pdf->writeHTMLCell(0, 0, '', '', $intro, 0, 1, 0, true, '', true);
309
310 /*
311 * Adding actual entries 303 * Adding actual entries
312 */ 304 */
313 foreach ($this->entries as $entry) { 305 foreach ($this->entries as $entry) {
@@ -315,6 +307,23 @@ class EntriesExport
315 $pdf->SetKeywords($tag->getLabel()); 307 $pdf->SetKeywords($tag->getLabel());
316 } 308 }
317 309
310 $publishedBy = $entry->getPublishedBy();
311 if (!empty($publishedBy)) {
312 $authors = implode(',', $publishedBy);
313 } else {
314 $authors = $this->translator->trans('export.unknown');
315 }
316
317 $pdf->addPage();
318 $html = '<h1>' . $entry->getTitle() . '</h1>' .
319 '<dl>' .
320 '<dt>' . $this->translator->trans('entry.view.published_by') . '</dt><dd>' . $authors . '</dd>' .
321 '<dt>' . $this->translator->trans('entry.metadata.reading_time') . '</dt><dd>' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '</dd>' .
322 '<dt>' . $this->translator->trans('entry.metadata.added_on') . '</dt><dd>' . $entry->getCreatedAt()->format('Y-m-d') . '</dd>' .
323 '<dt>' . $this->translator->trans('entry.metadata.address') . '</dt><dd><a href="' . $entry->getUrl() . '">' . $entry->getUrl() . '</a></dd>' .
324 '</dl>';
325 $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
326
318 $pdf->AddPage(); 327 $pdf->AddPage();
319 $html = '<h1>' . $entry->getTitle() . '</h1>'; 328 $html = '<h1>' . $entry->getTitle() . '</h1>';
320 $html .= $entry->getContent(); 329 $html .= $entry->getContent();
@@ -322,6 +331,14 @@ class EntriesExport
322 $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); 331 $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
323 } 332 }
324 333
334 /*
335 * Last page
336 */
337 $pdf->AddPage();
338 $html = $this->getExportInformation('tcpdf');
339
340 $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
341
325 // set image scale factor 342 // set image scale factor
326 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); 343 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
327 344