For files like PDFs, there’s no way to put canonical tags from the page header simply because there isn't any website page segment. In this sort of scenarios, you’ll should use HTTP headers to established canonicals. The JS redirect sounds like a certain amount of a messy situation, but to https://addons.prestashop.com/pl/seo-pozycjonowanie-naturalne/31857-automatyczne-google-rich-snippets-json-ld-opengraph-seo.html