我可以使用dompdf将发布的图像文件注入PDF吗?

I have a form where users can fill input boxes. In some cases, they're allowed to select images too.

The problem is, I don't want to save the image file somewhere on our server and give PDF the URL like this:

//Put uploaded file on public/uploads/ folder
<img src="{{ $imagePath }}" style="height: 50px; width: 50px;">

Instead, I'd like to inject uploaded image directly into PDF file. Something like this:

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

I'm beginner on PDF files and I'm not even sure if this is possible.

If it's possible, can anyone give me some advices?

Ps. I use DOMPDF package for Laravel 4. https://github.com/thujohn/pdf-l4

查看全部
doulingzou1712
doulingzou1712
2013/10/04 14:35
  • laravel
  • pdf
  • dompdf
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复