Skip to content
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

Cannot access a closed Stream. - Multi page snippits #6

Open
stephenhendry opened this issue Oct 18, 2017 · 1 comment
Open

Cannot access a closed Stream. - Multi page snippits #6

stephenhendry opened this issue Oct 18, 2017 · 1 comment
Assignees
Labels

Comments

@stephenhendry
Copy link
Contributor

I have found a bug with multipage documents that contain snippets. Once you go over one page you then get the error:

Cannot access a closed Stream.

To reproduce this change GetModel() in PdfController.cs to

        private DemonstrationModel GetModel()
        {
            return new DemonstrationModel
            {
                People = new List<string> { "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", "Alice", "Bob", "Charlie", }
            };
        }

Then go to /Pdf/ControllerlessPdfWithLayout.

@stephenhendry
Copy link
Contributor Author

Had a quick look and the line that is causing the issue is in AggregateHelper.cs

var snippetData = _pdfGeneratorFunc(null, snippet.Model, snippet.View, null, snippet.Margins);

This is pointing to InternalGeneratePdf.

@WiredUK WiredUK added the bug label Oct 22, 2017
@WiredUK WiredUK self-assigned this Oct 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants