We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21560
    • 145 Posts
    I’m getting an odd error with DOMPDF.

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Cannot modify header information - headers already sent
    Error type/ Nr.: Warning - 2
    File: /var/www/vhosts/Nimja.com/httpdocs/manager/includes/document.parser.class.inc.php
    Line: 466
    Line 466 source: header(’Content-Type: ’ . $type . ’; charset=’ . $this->config[’modx_charset’]);

    Parser timing
    MySQL: 0.0020 s (3 Requests)
    PHP: 0.6041 s
    Total: 0.6061 s


    The annoying thing is that I use another PDF generator (FPDF) that does the same thing, with less HTML support, but doesn’t give an error.

    Is it possible, through a snippet, to disallow/disable MODx header sending?
      [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
      • 21560
      • 145 Posts
      I fixed it myself.

      I found out DOMPDF has a "flush();" that basically f-s up the output of MODx

      I commented it out and now the PDF works fine. I will update my other post to show people how to do HTML pdfs’ wink
        [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com