We are unable to say what exactly causes the error. However, we noticed that the page does not validate with the W3C validator. There seems to be a problem with document encoding. Could you try to fix it and check to see if it helps?
wrote on 2017-02-08:
Here is the response from my web developer. Please continue to investigate this as the Print to PDF service is very spotty for us in terms of functionality on pages with embedded YouTube videos. Thanks.
" That validator is really picky and doesn't come close to validating for any page on the site, yet obviously many of the pages can be printed to pdf. As a test, I've taken a single page that cannot be printed to pdf and I've manually corrected all 120 validation errors/warnings. This page http://staging.cmcrescue.com/test_w3c.php now validates using that tool, but I still get the bad gateway error response almost immediately. This officially disproves their theory the issue is related to encoding or the page not passing strict validation.
The issue definitely seems to be tied to embedded youtube videos. Since sometimes it works and other times it doesn't, this likely points to some sort of timing issue. Their documentation says there is a timeout after 30 seconds if the page hasn't finished loading, but the 502 error we're getting happens after only a couple seconds. "
wrote on 2017-02-12:
Thank you for the information. We just wanted to rule out the possibility that the error is caused by non-validating HTML code. We investigated the issue further and it seems that it is a combination of several factors but we are unable to determine the primary cause. There is something in the HTML document layout which causes our converter to abort the conversion.
A simple document containing just the video converts without an error:
One thing you could try is the trial and error method - try to disable parts of the document or CSS and check to see if it helps. You can use the free conversion form on our web site for this.
wrote on 2017-02-14:
I've already tested removing just the video from the page and the PDF generates without issue in that case. We also know that sometimes the Freetech Harness PDF link works and sometimes it doesn't, which rules out there being something wrong with the HTML (the same page always has the same HTML).
What do you think? Could it be a time out issue in the render?
wrote on 2017-02-16:
wrote on 2017-02-16:
We don't use the API service. We use the "print to PDF". Any other ideas? Are there other users having the same issue?
wrote on 2017-02-19: