Problem downloading a PDF

Hello everyone, this is my first experience with Capacitor, I’m on a Vue.js application with pdf generation via pdfMake.

My problem is when in Android Studio, I try to download the pdf, it opens me the android message app.

Here is my code to generate the pdf :

      const pdfFile = pdfMake.createPdf(docDefinition);
      let pdfString = JSON.stringify(pdfFile);
      let platform = Capacitor.getPlatform();

      if (platform != "web") {
        try {
            path: nameFile,
            data: pdfString,
            directory: Directory.Documents,
            encoding: Encoding.UTF8,
            recursive: true
          }).then(() => {
              directory: Directory.Documents,
              path: nameFile,
              (getUriResult) => {
                const path = getUriResult.uri.replace("file:","content:");
      { url: `${path}.pdf` })
                  .then(() => console.log("File is opened"))
                  .catch((error) => console.log("Error openening file", error));
              (error) => {
        } catch (error) {
          console.error("Unable to write file", error);

Thank you for your help