improve aggregated pdf design

This commit is contained in:
Gregor Vostrak
2024-12-08 01:24:22 +01:00
committed by Constantin Graf
parent a4f3e014d9
commit 9b0cf37bc7
6 changed files with 318 additions and 127 deletions

View File

@@ -427,11 +427,12 @@ class TimeEntryController extends Controller
$request = Gotenberg::chromium(config('services.gotenberg.url'))
->pdf()
->waitForExpression("window.status === 'ready'")
->pdfa('PDF/A-3b')
->margins(0.39, 0.78, 0.39, 0.39)
->paperSize('8.27', '11.7') // A4
->footer(Stream::string('footer', $footerHtml))
->assets(Stream::path(resource_path('pdf-js/echarts.min.js'), 'echarts.min.js'))
->assets(Stream::path(resource_path('pdf/echarts.min.js'), 'echarts.min.js'),
Stream::path(resource_path('pdf/Outfit-VariableFont_wght.ttf'), 'outfit.ttf'),
)
->html(Stream::string('body', $html));
$tempFolder = TemporaryDirectory::make();
$filenameTemp = Gotenberg::save($request, $tempFolder->path(), $client);