显示 tinymces 中的内容与图像

Display content from tinymcewith images

提问人:Emmanuel 提问时间:9/18/2023 更新时间:9/18/2023 访问量:20

问:

我正在构建一个文档管理系统,允许用户使用 Tinymce 创建文档。用户可以将图像添加到文档中,然后保存文档将自动生成一个pdf文件。我目前正在使用 Dompdf,但问题是 pdf 不显示添加到文档中的图像。它仅显示未显示图像的文档内容。

以下是生成 pdf 的代码

$doc = Documentrole::find($id);
            $pdfPath = 'pdf/' . str_random(5) . '.pdf';
            $view = View('documents.dg.myPDF', ['docs' => $doc]);
            $pdf = \App::make('dompdf.wrapper');

            $pdf->getDomPDF()->setBasePath(public_path());

            $pdf->getDomPDF()->setHttpContext(
                stream_context_create([
                    'ssl' => [
                        'allow_self_signed'=> TRUE,
                        'verify_peer' => FALSE,
                        'verify_peer_name' => FALSE,
                    ]
                ])
              );
             $pdf = \PDF::setOptions(['isHTML5ParserEnabled' => true, 'isRemoteEnabled' => true]);
             $pdf->setOptions([
                'enable_remote' => true,
                'chroot'  => public_path('storage/uploads/'),
            ]);


            //$pdf = \PDF::setOptions(['isHtml5ParserEnabled' => true, 'isRemoteEnabled' => true]);
            $pdf->loadHTML($view->render())->save($pdfPath );
            $doc->path = $pdfPath;
            $doc->save();

图像 文件 tinymce 文档 dompdf

评论


答: 暂无答案