W3总缓存PDF预览显示为文本

时间:2017-09-25 05:58:05

标签: wordpress plugins fpdf w3-total-cache

我在Wordpress中安装了W3总缓存插件。我已经设法缩小CSS和js脚本,但我有一个PDF生成器,它可以从帖子中生成数据。停用插件时,它可以生成PDF但是当插件被激活时,它会在浏览器中显示,如下图所示:

enter image description here

我使用fpdf生成PDF。以下是我生成PDF的代码:

    $pdf = new PDF();
    // Column headings
    $header = array('Lot', 'Estate', 'Suburb', 'Land Size', 'House Name','Package Price','Est. Titles');

    // Data loading
    $post_data = get_recent_properties();

    $pdf->SetFont('Arial','',10);
    $pdf->AddPage();
    $pdf->SetMargins(5,5,5);
    $pdf->BasicTable($header,$post_data);
    $pdf->Output();

我还重置了W3总缓存设置,但仍然无法预览PDF。

1 个答案:

答案 0 :(得分:0)

尝试在浏览器缓存设置中禁用(取消选中)Enable HTTP (gzip) compression