More compact writing of PDF objects to strings (used in pdfops.ml)