#1 Consider a warning notice that says "If error occurs generating pdf of page, suggest using your OS 'Print to PDF' options"
Chrome has "print to PDF" that works pretty well (which is what I use when the process fails).
#2 Make your PDF routines an open source effort on GitHub w/ some oversight.