diff --git a/src/UglyToad.PdfPig.Tests/Integration/SinglePageLibreOfficeImages.cs b/src/UglyToad.PdfPig.Tests/Integration/SinglePageLibreOfficeImages.cs index 59664bdf..2a8b253f 100644 --- a/src/UglyToad.PdfPig.Tests/Integration/SinglePageLibreOfficeImages.cs +++ b/src/UglyToad.PdfPig.Tests/Integration/SinglePageLibreOfficeImages.cs @@ -1,5 +1,9 @@ namespace UglyToad.PdfPig.Tests.Integration { +#if NET9_0_OR_GREATER + using Microsoft.AspNetCore.WebUtilities; +#endif + public class SinglePageLibreOfficeImages { private static string GetFilePath() => IntegrationHelpers.GetDocumentPath(@"Single Page Images - from libre office.pdf"); @@ -17,6 +21,23 @@ } } + #if NET9_0_OR_GREATER + [Fact] + public void CanUseFileBufferingReadStream() + { + var bytes = File.ReadAllBytes(GetFilePath()); + + using var mem = new MemoryStream(bytes); + using var fbrs = new FileBufferingReadStream(mem, 256); + + using var doc = PdfDocument.Open(fbrs); + + var page = doc.GetPage(1); + + Assert.NotEmpty(page.Text); + } + #endif + [Fact] public void ImagesHaveCorrectDimensionsAndLocations() { diff --git a/src/UglyToad.PdfPig.Tests/UglyToad.PdfPig.Tests.csproj b/src/UglyToad.PdfPig.Tests/UglyToad.PdfPig.Tests.csproj index e3e298c8..fb829a70 100644 --- a/src/UglyToad.PdfPig.Tests/UglyToad.PdfPig.Tests.csproj +++ b/src/UglyToad.PdfPig.Tests/UglyToad.PdfPig.Tests.csproj @@ -208,4 +208,9 @@ + + + 9.0.8 + +