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 061859cb5b..40f3c467c5 100644 --- a/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py +++ b/pyramid_oereb/contrib/print_proxy/mapfish_print/mapfish_print.py @@ -115,7 +115,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: