Return concatenated string of all labels rules. Args: labels: (list) dictionaries as created by function 'rule_dict'. Returns: PDF compatible string for page label definitions, ready to be enclosed in PDF array 'Nums[...]'.
(labels)
| 7110 | return s |
| 7111 | |
| 7112 | def create_nums(labels): |
| 7113 | """Return concatenated string of all labels rules. |
| 7114 | |
| 7115 | Args: |
| 7116 | labels: (list) dictionaries as created by function 'rule_dict'. |
| 7117 | Returns: |
| 7118 | PDF compatible string for page label definitions, ready to be |
| 7119 | enclosed in PDF array 'Nums[...]'. |
| 7120 | """ |
| 7121 | labels.sort(key=lambda x: x["startpage"]) |
| 7122 | s = "".join([create_label_str(label) for label in labels]) |
| 7123 | return s |
| 7124 | |
| 7125 | doc._set_page_labels(create_nums(labels)) |
| 7126 |
nothing calls this directly
no test coverage detected