asHkER
asHkER

Reputation: 435

W3 Total Cache PDF Preview is displayed as text

I have a W3 total cache plugin installed in Wordpress. I have managed to minify CSS and js scripts but I have a PDF generator which generates data from posts. When deactivating the plugin, it can generate PDF but when the plugin is activated it displays in the browser like the image below:

enter image description here

I use fpdf to generate PDF. Below is my code to generate the 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();

I also reset W3 total cache settings but still PDF not previewing.

Upvotes: 0

Views: 111

Answers (1)

Argus Duong
Argus Duong

Reputation: 2654

Try to disable (un-check) Enable HTTP (gzip) compression in Browser cache settings.

Upvotes: 0

Related Questions