Dompdf尺寸减小在Localhost中运行良好但在现场没有

时间:2017-09-19 05:07:46

标签: pdf wkhtmltopdf dompdf html-to-pdf

缩小代码在localhost中运行良好,但是当我测试它时,我的pdf页面显示为空白且代码为$html = '<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="Content-Type: application/pdf; charset=utf-8"/> <link rel="stylesheet" href="style.css"> <div style="width:800px; height:970px; padding:20px; border: 10px solid #787878"> <style> body { body {font-family: "NotoSansCJKtc-Regular"} } </style> <div style="width:750px; height:915px; padding:20px; border: 5px solid #787878"> //pdf content is here </div> </div> </html>'; $dompdf->loadHtml($html); $dompdf->setPaper('A4', 'landscape'); $dompdf->getOptions()->setIsFontSubsettingEnabled(true); /* Render the HTML as PDF */ $dompdf->render(); header('Content-Type: application/pdf; charset=utf-8'); header('Content-disposition: inline; filename="' . $no . '.pdf"', true); /* Output the generated PDF to Browser */ $dompdf->stream();

当我删除上面的行..pdf工作正常,但大小是18MB.i希望使用相同的字体系列将我的PDF大小减少到50KB。

apply plugin: 'com.android.application'

0 个答案:

没有答案