Editing existing PDF streams in 'replacement' mode

Q:

We would like to try modifying the Type3 font stream using ElementReader/Writer, but when calling ElementWriter.Begin() there isn’t an overload that allows us to set the WriteMode to “e_replacement” when working with an SDF.Obj (it only exists for PDF.Page). Is this something that would be easy to add?

A:

You can achieve the desired effect with ElementWriter.Begin(doc, …). This will create a brand new stream object.

After you are done creating the stream, if required you can copy any extra key/value pairs from the original stream (except for Length, Filter, Resources ). You can also swap the new stream with the old one with doc.Swap(obj_old.GetObjNum(), obj_new.GetObjNum()).