| 16065 | |
| 16066 | @staticmethod |
| 16067 | def write_stabilized_with_links(contentfn, rectfn, user_css=None, em=12, positionfn=None, pagefn=None, archive=None, add_header_ids=True): |
| 16068 | #log("write_stabilized_with_links()") |
| 16069 | stream = io.BytesIO() |
| 16070 | writer = DocumentWriter(stream) |
| 16071 | positions = [] |
| 16072 | def positionfn2(position): |
| 16073 | #log(f"write_stabilized_with_links(): {position=}") |
| 16074 | positions.append(position) |
| 16075 | if positionfn: |
| 16076 | positionfn(position) |
| 16077 | Story.write_stabilized(writer, contentfn, rectfn, user_css, em, positionfn2, pagefn, archive, add_header_ids) |
| 16078 | writer.close() |
| 16079 | stream.seek(0) |
| 16080 | return Story.add_pdf_links(stream, positions) |
| 16081 | |
| 16082 | def write_with_links(self, rectfn, positionfn=None, pagefn=None): |
| 16083 | #log("write_with_links()") |