question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when generating pdf

See original GitHub issue

When trying to generate a pdf after updating to latest nuget package (0.111.2), I receive the following error: PlaywrightSharpException: options.format.toLowerCase is not a function

after calling it like this:

var result = await page.GetPdfAsync(null, pdfConversionOptions.Scale, pdfConversionOptions.DisplayHeaderFooter, pdfConversionOptions.HeaderTemplate, pdfConversionOptions.FooterTemplate,
  pdfConversionOptions.PrintBackground, pdfConversionOptions.Landscape, pdfConversionOptions.PageRanges, pdfConversionOptions.Format, pdfConversionOptions.Width, pdfConversionOptions.Height,
  pdfConversionOptions.Margin, pdfConversionOptions.PreferCSSPageSize);

I tried also specifying directly PaperFormat.Letter for example but I receive the same error…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
lvmajorcommented, Sep 30, 2020

Yeah no problem simply run the app, I edited the home page index endpoint, so it is generating the pdf file by default (see HomeController.cs -> Index endpoint on line 23)

1reaction
lvmajorcommented, Sep 30, 2020

Okay for the margins, it’s a css problem I think, so no need to investigate on your side for that, but for the error, I still haven’t figured it out

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create PDF does not work, results in error | Firefox, Chrome
Solution: Make sure that Acrobat is activated · Ensure that your Acrobat is activated. For more information, see Learn to activate or deactivate ......
Read more >
"Error generating PDF" Message is Displayed when Creating ...
Navigate to folder \GSX Analyzer\Agent\AutomatedTrendsPdf\ using Windows File Explorer. · Right-click the folder and select Properties. · Select ...
Read more >
how to get rid of exception while generating PDF using iText
I would start with checking my library dependencies and find if some libraries are not expecting different versions of iText. If so, I...
Read more >
Error generating PDF in R Markdown
Hi guys, I'm using R Markdown to generate a report of my graphs. However, I can only generate in HTML or Word format,...
Read more >
Error when generating PDF file
Hi Venu,. It seems like an authorization issue while accessing from GUI. Please note that users must have authorization to the printer to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found