Closed wstaelens closed 1 year ago
I think the documentation should be updated. AFAIK not all streams allow setting the position. The PDFsharp could check if the stream supports setting the position and set it to 0 if supported - but that would make documentation even more complicated.
When using
PdfSharp.Pdf.IO.PdfReader.TestPdfFile(Stream)
This code will fail when you were working with the stream before and if the stream position is not manually set to 0.
Is this expected behavior that you need to manually set the
stream.Position = 0;
before usingTestPdfFile(Stream)
to ensure this code always correctly works, or is the position reset missing in the source code ( https://github.com/empira/PDFsharp/blob/master/src/PdfSharp/Pdf.IO/PdfReader.cs#L124 ) ?I guess it is a bug, otherwise API documentation should be updated.