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)
| 4928 | return s |
| 4929 | |
| 4930 | def create_nums(labels): |
| 4931 | """Return concatenated string of all labels rules. |
| 4932 | |
| 4933 | Args: |
| 4934 | labels: (list) dictionaries as created by function 'rule_dict'. |
| 4935 | Returns: |
| 4936 | PDF compatible string for page label definitions, ready to be |
| 4937 | enclosed in PDF array 'Nums[...]'. |
| 4938 | """ |
| 4939 | labels.sort(key=lambda x: x["startpage"]) |
| 4940 | s = "".join([create_label_str(label) for label in labels]) |
| 4941 | return s |
| 4942 | |
| 4943 | doc._set_page_labels(create_nums(labels)) |
| 4944 |
no test coverage detected
searching dependent graphs…