X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FHelper%2FEntriesExport.php;h=1debdf8e457af9847db482fd82b25311d834c56e;hb=ad5ef8bca0c0321f348dcf402e0a20791eca3f4d;hp=9cde27c68bc041fa5a6c463456943f67c982ee13;hpb=4944703edc7cdd2c8cd645b785603b4405d2a288;p=github%2Fwallabag%2Fwallabag.git
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
@@ -299,14 +299,6 @@ class EntriesExport
$pdf->SetSubject('Articles via wallabag');
$pdf->SetKeywords('wallabag');
- /*
- * Front page
- */
- $pdf->AddPage();
- $intro = '
' . $this->title . '
' . $this->getExportInformation('tcpdf');
-
- $pdf->writeHTMLCell(0, 0, '', '', $intro, 0, 1, 0, true, '', true);
-
/*
* Adding actual entries
*/
@@ -315,6 +307,23 @@ class EntriesExport
$pdf->SetKeywords($tag->getLabel());
}
+ $publishedBy = $entry->getPublishedBy();
+ if (!empty($publishedBy)) {
+ $authors = implode(',', $publishedBy);
+ } else {
+ $authors = $this->translator->trans('export.unknown');
+ }
+
+ $pdf->addPage();
+ $html = '' . $entry->getTitle() . '
' .
+ '' .
+ '- ' . $this->translator->trans('entry.view.published_by') . '
- ' . $authors . '
' .
+ '- ' . $this->translator->trans('entry.metadata.reading_time') . '
- ' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '
' .
+ '- ' . $this->translator->trans('entry.metadata.added_on') . '
- ' . $entry->getCreatedAt()->format('Y-m-d') . '
' .
+ '- ' . $this->translator->trans('entry.metadata.address') . '
- ' . $entry->getUrl() . '
' .
+ '
';
+ $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
+
$pdf->AddPage();
$html = '' . $entry->getTitle() . '
';
$html .= $entry->getContent();
@@ -322,6 +331,14 @@ class EntriesExport
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
}
+ /*
+ * Last page
+ */
+ $pdf->AddPage();
+ $html = $this->getExportInformation('tcpdf');
+
+ $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
+
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);