Score:-3

Create a pdf from a custom module using entity print module

us flag

I have created a custom module and it has a path /{nodeid}/{userid}. I'm using Entity Print module to create pdf. I'm trying to render the pdf using a link (/print/pdf/node/{nodeid}/{userid}) as mentioned in the documentation. But this simple loads a page not a pdf.

Drupal version is 9.

module routing yml:

  certificate.content:
      path: '/{nodeid}/{userid}'
      defaults:
          _controller: 'Drupal\certificate\Controller\CertificateController::content'
      requirements:
        _permission: 'access content'
Kevin avatar
in flag
Routes cannot begin with a dynamic parameter.
Kevin avatar
in flag
In fact, the parameters you are passing aren't defined in the route, so they likely don't resolve.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.