When adding embedded files, the Catalog dictionary is extended with a Name entry only when there isn’t one. When there is already a Name entry in the Catalog, it’s the Name which is extended as the Catalog can have only one Names entry according to the PDF’s spec.
When adding embedded files, the Catalog dictionary is extended with a Name entry only when there isn’t one.
When there is already a Name entry in the Catalog, it’s the Name which is extended as the Catalog can have only one Names entry according to the PDF’s spec.

Internal links were broken with embedded files because an other Name entry was added and so PDF readers forgot the previous one containing the link’s destination.

Fix #1203.

Kozea/WeasyPrint,Kozea/WeasyPrint