[o] implement Document#rewrite [o] doc.add_stream { |st| st.bt ... } [o] st = d.addstream st.tf '/helv', 12 st.bt 5, 6, "hello" d.write('out.pdf') # closes the stream... [ ] fail if insert_content or insert_font on an unclosed stream obj [o] Document.write('-') (stdout inspiration) [ ] stop using the st-mark thing [ ] recompress idea? uncompress with pdftk, recompress with podoff smaller docs anyway... /Filter /FlatDecode decompress: qpdf --qdf --object-streams=disable in.pdf out.pdf recompress: qpdf in.pdf out.pdf