Skip to content

PdfGenerator.GeneratePdf failed to add page #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PrakashPaul opened this issue Feb 23, 2023 · 0 comments
Open

PdfGenerator.GeneratePdf failed to add page #1

PrakashPaul opened this issue Feb 23, 2023 · 0 comments

Comments

@PrakashPaul
Copy link

PdfDocument document = new PdfDocument(); PdfGenerateConfig config = new PdfGenerateConfig(); config.PageOrientation = PdfSharpCore.PageOrientation.Portrait; config.PageSize = PdfSharpCore.PageSize.A4; config.MarginLeft = 10; config.MarginRight = 10; config.MarginTop = 10; config.MarginBottom = 10; const string filename = "HelloWorld.pdf"; MemoryStream stream = new MemoryStream(); document = PdfGenerator.GeneratePdf(sbHTML.ToString(), config); PdfGenerator.AddPdfPages(document, sbHTML.ToString(), config, null,null); document.Save(@"D:\AForge\" + filename); //UploadFile(stream, filename);

failed with exception "Cannot save a PDF document with no pages"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant