Fix PDF generation – reset stream position (#40072)

<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
This is an additional fix that extends the work done in
https://github.com/microsoft/PowerToys/pull/40023

fix #39851
This commit is contained in:
leileizhang
2025-06-17 14:25:08 +08:00
committed by GitHub
parent f7257bf1d1
commit 655398e173

View File

@@ -228,6 +228,8 @@ namespace Microsoft.PowerToys.PreviewHandler.Pdf
DestinationWidth = (uint)this.ClientSize.Width,
}).GetAwaiter().GetResult();
stream.Seek(0); // Reset the stream position to the beginning before reading.
imageOfPage = Image.FromStream(stream.AsStream());
}