1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

PDF produces grey page

Discussion in 'Community' started by Metabern, May 15, 2019 at 9:36 PM.

  1. Metabern

    Metabern Member

    Level: Community
    After getting Fabrik to successfully grab all of the required elements from my Virtuemart order setup to create custom purchase orders, the PDF button on my form detail page produces a grey screen with no pdf, not even the default one. This was working before and I'm not sure how and why its not now.

    Please help.

    Cheers
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Can you enable PDF debug, and take a look at the simple HTML output, see if there's anything obviously moofed in that.

    Also, perhaps try switching PDF engines in Fabrik global options (so DOMPDF to MPDF, or vice versa).

    Typically, problems with PDF generation are down to HTML markup in the view which the PDF engine's HTML to PDF coverter can't handle. Sometimes DOMPDF will render stuff MPDF can't, or vice versa.

    First step is to get the raw HTML from debug mode, and run that through something like w3's validator, see if there's any obvious formatting errors (missing close divs, etc).

    -- hugh
     
  4. Metabern

    Metabern Member

    Level: Community
  5. Metabern

    Metabern Member

    Level: Community

    I enabled debug PDF mode and tried pdf and dompdf, I am not seeing any html anywhere. Is there a log somewhere?
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    With PDF debug enabled, when you click the PDF button in the details page, you should get an HTML response back in the browser (replacing the normal details view). Is that not happening?

    -- hugh
     
  7. Metabern

    Metabern Member

    Level: Community
    In Safari I get a grey screen, In Chrome a grey screen with "Error - Failed to load PDF document"
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    Did you really enable the Fabrik PDF debug (in Fabrik Options "Debugging")?
     
  9. Metabern

    Metabern Member

    Level: Community
    As far as I know, yes. Screen Shot 2019-05-16 at 6.43.59 PM.png
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Hmmm, is "Error - Failed to load PDF document" the exact error message?

    If so, that's strange, because that string doesn't occur anywhere in Fabrik.

    Are you sure you haven't installed or enabled some other extension that handles the format=pdf document type?

    -- hugh
     
  11. troester

    troester Well-Known Member Staff Member

    Level: Community
  12. Metabern

    Metabern Member

    Level: Community

    Yes thats the exact message. Appears to be a Chrome Browser error message.

    THe PDF extensions that are running (Virtuemart & VM-Invoice) are working fine.

    Looking at Troester's reference to my previous PDF issues, I tried reinstalling TCPDF from VM. Now I get the following: (No more grey screen)

    0 Call to undefined method JDocumentPDF::setPaper()

    Your help is greatly appreciated

    Cheers
     
  13. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Are you sure our PDF document type is still there? That the Fabrik PDF document files ...

    https://github.com/Fabrik/fabrik/tree/master/libraries/src/Document

    ... exist in your ./libraries/src/Document folder?

    Your error message, referencing JDocumentPDF, seem to indicate that Joomla didn't autoload our PdfDocument. The way the J! document loader works is here ...

    https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Document/Document.php#L292

    ... where it first tests to see if the PdfDocument class exists, and if not, test for JDocumentPDF.

    But the main problem is that J! autoloads the document handler. So you can only have one handler for a given document type.

    -- hugh
     

Share This Page