Skip to content

Support "or-ing" together open modes #1

Description

@jmanm

Resources

The official project web site:
http://pdfsharp.net/

The official peer-to-peer support forum:
http://forum.pdfsharp.net/

Reporting an Issue Here

Expected Behavior

No exception thrown when saving.

Actual Behavior

InvalidOperationException: "Cannot save a PDF document with no pages."

Steps to Reproduce the Behavior

using (var readStream = new MemoryStream())
using (var writeStream = new MemoryStream())
{
	var pdf = new PdfDocument();
	pdf.AddPage();
	pdf.Save(readStream);

	readStream.Seek(0, SeekOrigin.Begin);
	pdf = PdfReader.Open(readStream, PdfDocumentOpenMode.Import | PdfDocumentOpenMode.Modify);
	pdf.Save(writeStream);
}

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions