1

I have a C# app that uses Puppeteer-Sharp to convert HTML pages to PDF. Everything works great except for one issue. I have a fieldset within which a JavaScript file is used to move checkboxes from the right of the question to the left. When I view the original HTML, the checkboxes have been moved, but in the PDF they are still on the right side. I would like to find out what is going wrong, but I don't know how to get Puppeteer-Sharp to output any error information.

I found this question/answer, which sounds like it is the solution, but I'm not sure what the person actually did or how to make use of it. How do I get readable browser/page errors out of puppeteer-sharp?

Erica Ackerman
  • 189
  • 1
  • 2
  • 11
  • 1
    Does this answer your question? [How do I get readable browser/page errors out of puppeteer-sharp?](https://stackoverflow.com/questions/56959242/how-do-i-get-readable-browser-page-errors-out-of-puppeteer-sharp) – c161c Aug 23 '23 at 18:32

1 Answers1

1

The best I could find was this, from an issue on hardkoded/puppeteer-sharp on github:

var page = await browser.NewPageAsync();
page.PageError += (sender, eventArgs) =>
{
   Console.WriteLine("Error Found:");
   Console.WriteLine($"     {eventArgs.Message}");
};
Erica Ackerman
  • 189
  • 1
  • 2
  • 11