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.

I got an 'System.InvalidOperationException' and message 'Cannot save a PDF document with no pages.'

See original GitHub issue

I generate a PdfDocument with TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(html, PdfSharp.PageSize.Letter), and the html has contents, but the PdfDocument is empty and cause a ‘System.InvalidOperationException’ when i save the document by pdf.Save(memoryStream)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
brettflittercommented, Aug 28, 2018

Same for me when using in a Azure Function

0reactions
cfrancolunacommented, Dec 15, 2021

@benj2240 Ok thank for your time

Read more comments on GitHub >

github_iconTop Results From Across the Web

View topic - Cannot save a PDF document with no pages
However, this fails with the error message "Cannot save a PDF document with no pages". But if I add one line to the...
Read more >
Sending a PDFsharp document to WCF service and saving ...
Creates a new PDF document using the specified stream. The stream won't be used until the document is closed, at that time the...
Read more >
I got an 'System.InvalidOperationException' and message ' ...
I got an 'System.InvalidOperationException' and message 'Cannot save a PDF document with no pages.'
Read more >
How to save a PDF when "Save as" is not working
Open the file in Acrobat. · Click Acrobat and choose Preferences at the bottom of the dropdown menu. · In the Preferences panel,...
Read more >
I suddenly can't save a Word file as a PDF. I get the message
Open the document, go to File>Printer, select Microsoft Printer to PDF as printer, then click print button and check if you can export...
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