Skip to content

Error 'System.InvalidOperationException: 'Byte[]' must not be null here.' #323

@evgenyshugaev

Description

@evgenyshugaev

Hello.
We are using package PdfSharp (6.2.3) with net9.0.
And some simpe code for merging image to pdf:

			var ms = new MemoryStream(content, 0, content.Length, true, publiclyVisible: true);
			var document = PdfReader.Open(ms, PdfDocumentOpenMode.Modify);
				
            for (int i = 0; i < document.PageCount; i++)
			{
					try
					{
			            // error here
                        using XGraphics gfx = XGraphics.FromPdfPage(page);

                        // ... some code

					}
					catch (Exception ex)
					{
						Logger.Log(ex, ExceptionSource.WebForm);
					}
			`}`

and we have got error for pages 12, 13, 15. Files with issue uploaded to your ftp server with name pdfsharp6-2-3-error-FromPdfPage.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions