我有一个表单,用户可以填写输入框。在某些情况下,他们也可以选择图像。我可以使用dompdf将张贴的图像文件注入到PDF中吗?
的问题是,我不想保存在某个地方我们的服务器上的图像文件,并给PDF这样的网址:
//Put uploaded file on public/uploads/ folder
<img src="{{ $imagePath }}" style="height: 50px; width: 50px;">
相反,我想直接注入上传图像到PDF文件。这样的事情:
PDF::load($data, 'A4', 'portrait')->inject('image', Input::file('resim'))->output();
//So I can reference it as {{ $image }} on PDF template, but image will be injected into PDF file
我是初学者的PDF文件,我甚至不确定这是否可能。
如果可能的话,任何人都可以给我一些建议吗?
Ps。我使用Laravel 4的DOMPDF软件包。https://github.com/thujohn/pdf-l4
我正在使用第一个选项。我确定数据uris会在某个时候派上用场! – Aristona