PdfDocument save without setting stream's position
PDFsharp is a .NET library for creating and modifying PDF documents.
Brought to you by:
pdfsharp,
stefan_lange
For clarity: Do you want PDFsharp to work with streams that do not support setting the position?
Do you want PDFsharp to work with streams that already have contents?
The former can be achieved with a trivial change, the latter would require a bit more effort.
Thank you for quick response. The first one, without setting position.
The current implementation sets the Position to 0 before returning from Save(), but it queries Position several times during the creation of the PDF. Do you get an exception from the final "setter"? Or do you get exceptions from the "getter" at an earlier stage? The former can easily be avoided, the latter requires bigger changes (too big for 1.50 final).
The .NET documentation isn't very clear and implementation may vary between different Stream classes. Which Stream class did you use when you encountered the problem? Would you share sample code?