Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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