diff --git a/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py b/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py index ccefbbc55b..0527815880 100644 --- a/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py +++ b/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py @@ -122,7 +122,10 @@ def __call__(self, value, system): pdf_reader = PdfReader(pdf) x = [] for i in range(len(pdf_reader.outline)): - x.append(pdf_reader.outline[i]['/Page']['/StructParents']) + if isinstance(pdf_reader.outline[i], list): + x.append(pdf_reader.outline[i][0]['/Page']['/StructParents']) + else: + x.append(pdf_reader.outline[i]['/Page']['/StructParents']) try: true_nb_of_toc = min(x)-1 except ValueError: