refactor: split write_outfile and do_split_pages
refactor: split write_outfile and do_split_pages

jberkenbilt/qpdf,qpdf/qpdf,qpdf/qpdf,qpdf/qpdf,jberkenbilt/qpdf,qpdf/qpdf,jberkenbilt/qpdf,qpdf/qpdf,jberkenbilt/qpdf,jberkenbilt/qpdf