solved it....one liner
Code:
Dim modifiedcontentbytes() As Byte = contents.ToContent
works brilliant
In case the Development Team reads this,
viewtopic.php?f=3&t=3468 same issue there about removing /Filter first, which is not intuitive to the average user.
Any of the following would make this great library even better
1- update the existing summary to function CreateStream
' Summary:
' Creates the stream of this dictionary and initializes it with the specified byte
' array. The function must not be called if the dictionary already has a stream.
' You may need to remove the existing /Filter from the parent element object first
Public Function CreateStream(value() As Byte) As PdfStream
2- update the existing summary to property
' Summary:
' Gets or sets the PDF stream belonging to this dictionary. Returns null if the
' dictionary has no stream. To create the stream, call the CreateStream function.
' You may need to remove the existing /Filter from the parent element object first
Public Property Stream As PdfStream
3-
Implement Method .CreateStreamWithFilter, or allow an additonal Parameter in
Public Function CreateStream(value() As Byte, updateFilter as Boolean) As PdfStream
and let PDFSharp set/clear the existing /Filter on the parent stream object
4-
' Summary:
' Compresses the stream with the FlateDecode filter. If a filter is already defined,
' the function has no effect.
Public Sub Zip()
Add an optional parameter or overload Public Sub Zip(ResetFilter as boolean) which deletes the existing Filter, does the zipping and sets its own proper filter.
Thank you