The message used as the title of this thread, upon an attempt to load the generated PDF, in Chrome. As a side note, these occasional but repeatable failures occur across different browsers, although some browsers produce different failures than others: On Chrome, nothing loads at all, for example, other than the Acrobat background and the above-referenced message. Firefox manages to load some of the document header, and also offers some other options (that don’t do any good). Meanwhile, as noted, many similar or even nearly identical documents (or documents based on near-identical inputs) load as desired.
Just to give you some background:
I have two different documents, originally consisting of an HTML table or set of tables, with a few headings and a paragraph or two, with dynamic content derived from user and WooCommerce order and product data.
I don’t know how much more detail would be useful for you. I’ll just say here that the document HTML is returned via ob_get_clean() in a shortcode function. Originally, I ran some logic after the original ob_start(). As errors popped up, I found that it helped to move all calculations, no matter how simple – many were of the general type echo $response ? $response : $no_response
– outside of the object declaration.
In other words, I am now deploying no PHP more complicated than echo $variable
between ob_start() and ob_get_clean(). I still got another load failure this week. This time, I was able to clear the error by simplifying the document even further, converting two tables to just one.
I wonder if there isn’t some memory- or capacity-related bottleneck interfering with PDF generation, though I’ve also tried increasing PHP memory limits without effect. However, I don’t understand that part of the process very well.
If you want to look into this further, I can give you access and show you the PHP I’m using. I don’t really expect you to do that, though – I was really just hoping for some clues on where to look next.