在laravel中显示pdf

时间:2017-03-23 10:52:03

标签: laravel pdf laravel-5

我正在创建一个作者上传pdf文件的网站。我创建我的网站的方式是有一个页面显示故事标题,如果一个人点击标题它使用故事标题去故事,但我想要一个pdf显示当标题是陈词滥调。我不知道从哪里开始。我曾尝试过barryvdh / laravel-dompdf,但它没有" partial"部分显示pdf。它只允许将pdf视为整页。我希望我有道理。

类似于此Google Books

的内容

1 个答案:

答案 0 :(得分:2)

尝试这种方式:

libtool --mode=execute valgrind --tool=memcheck --log-file=ValgrindLog.log YourProgram

试试这个html对象标签:

$filename = 'test.pdf';
$path = storage_path($filename);

return Response::make(file_get_contents($path), 200, [
    'Content-Type' => 'application/pdf',
    'Content-Disposition' => 'inline; filename="'.$filename.'"'
]);
相关问题