---
title: Grant Application Form
product: PDF Generator
description: Get a printable grant application form in PDF. Create editable or prefilled grant request forms using SurveyJS PDF Generator.
framework: Vue 3
source: https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/vue3js
index: https://surveyjs.io/pdf-generator/examples/overview.md
---

# Grant Application Form (Vue 3)

## Files

### `public/index.html`

```html
<div style="display: flex;">
    <div id="app" style="flex: 1 1 0%; height: 100%; min-width: 0;"></div>
    <div id="pdf-preview" style="flex: 0.7 0.7 0%; display: none">
        <embed id="pdf-preview-frame" type="application/pdf" style="width:100%; height:100%;" />
    </div>
</div>
```

### `src/App.vue`

```html
<template>
    <SurveyComponent :model="survey" />
</template>
<script setup lang="ts">
    import { Model } from "survey-core";
    import { SurveyComponent } from "survey-vue3-ui";
    import "survey-core/survey-core.min.css";
    import { SurveyPDF } from "survey-pdf";
    import "./index.css";
    import { json } from "./json";

    function createSurveyPdfModel (surveyModel) {
        const surveyPDF = new SurveyPDF(json);
        if (surveyModel) {
            surveyPDF.data = surveyModel.data;
            surveyPDF.locale = surveyModel.locale;
            
            
        }
        
        return surveyPDF;
    }
    function saveSurveyToPdf (filename, surveyModel) {
        const pdfDoc = createSurveyPdfModel(surveyModel);
        if (!pdfDoc) return;
    
        pdfDoc.save(filename);
    }
    
    const previewDiv = document.getElementById("pdf-preview");
    const previewEmbed = document.getElementById("pdf-preview-frame");
    let pdfBlobUrl;
    
    function showPdfPreview(surveyModel) {
        if (!previewDiv || !previewEmbed) return;
    
        const pdfDoc = createSurveyPdfModel(surveyModel);
        if (!pdfDoc) return;
    
        pdfDoc.raw("blob").then((blob) => {
            if (pdfBlobUrl) {
                URL.revokeObjectURL(pdfBlobUrl);
            }
            pdfBlobUrl = URL.createObjectURL(blob);
            previewEmbed.setAttribute("src", pdfBlobUrl);
            previewDiv.style.display = "block";
        });
    }
    
    function previewPdf(surveyModel) {
        if (!previewDiv) return;
    
        if (previewDiv.style.display !== "none") {
            previewDiv.style.display = "none";
            return;
        }
    
        showPdfPreview(surveyModel);
    }
    
    const survey = new Model(json);
    survey.showCompleteButton = false;
    survey.navigationButtonsLocation = "topBottom";
    survey.addNavigationItem({
        id: "survey_save_as_file",
        title: "Download PDF",
        action: () => {
            saveSurveyToPdf("surveyResult.pdf", survey);
        }
    });
    survey.addNavigationItem({
        id: "survey_pdf_preview",
        title: "Preview PDF",
        visible: window.navigator.pdfViewerEnabled,
        action: () => {
            previewPdf(survey);
        }
    });
</script>
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/json.ts`

```ts
export const json = {
  "title": "Grant Application Form for NPO",
  "pages": [
    {
      "name": "contact-information",
      "title": "1. Contact Information",
      "elements": [
        {
          "type": "text",
          "name": "contact-information-name",
          "title": "Name"
        },
        {
          "type": "text",
          "name": "contact-information-reg-number",
          "startWithNewLine": false,
          "title": "Organization registration number or date of birth"
        },
        {
          "type": "text",
          "name": "contact-information-address",
          "title": "Postal address"
        },
        {
          "type": "text",
          "name": "contact-information-municipality",
          "title": "Municipality"
        },
        {
          "type": "text",
          "name": "contact-information-county",
          "startWithNewLine": false,
          "title": "County"
        },
        {
          "type": "text",
          "name": "contact-information-tel",
          "title": "Telephone number including country and area codes"
        },
        {
          "type": "text",
          "name": "contact-information-fax",
          "startWithNewLine": false,
          "title": "Fax number including country and area codes (if applicable)"
        },
        {
          "type": "text",
          "name": "contact-information-email",
          "title": "Email address",
          "inputType": "email"
        },
        {
          "type": "text",
          "name": "contact-information-website",
          "startWithNewLine": false,
          "title": "Website (if applicable)",
          "inputType": "url"
        },
        {
          "type": "text",
          "name": "contact-information-contact-person",
          "title": "Contact person (project manager, if applicable)"
        }
      ]
    },
    {
      "name": "applicant-details",
      "title": "2. Information About the Applicant",
      "elements": [
        {
          "type": "boolean",
          "name": "VAT",
          "displayMode": "checkbox",
          "title": "Registered for VAT"
        },
        {
          "type": "boolean",
          "name": "registered-employer",
          "displayMode": "checkbox",
          "title": "Registered as an employer",
          "startWithNewLine": false
        },
        {
          "type": "text",
          "name": "vat-number",
          "title": "VAT registration number",
          "description": "Complete if the applicant is registered for VAT."
        },
        {
          "type": "boolean",
          "name": "bankruptcy",
          "displayMode": "checkbox",
          "title": "The applicant is in a state of bankruptcy, under administration, or has debts for taxes or social security contributions"
        },
        {
          "type": "checkbox",
          "name": "use",
          "title": "The grant will be used for the following activities (if applicable)",
          "choices": [
            {
              "value": "business",
              "text": "Business activity"
            },
            {
              "value": "vat",
              "text": "Activity that requires filing VAT returns"
            }
          ]
        },
        {
          "type": "radiogroup",
          "name": "organization-form",
          "title": "Organizational form",
          "colCount": 2,
          "showOtherItem": true,
          "choices": [
            "Non-profit organization",
            "Foundation",
            "Limited company",
            "Registered religious community"
          ]
        },
        {
          "type": "text",
          "name": "operational-focus",
          "title": "Organization's operational focus"
        },
        {
          "type": "text",
          "name": "foundation-date",
          "startWithNewLine": false,
          "title": "Date the organization was formed",
          "inputType": "date"
        },
        {
          "type": "text",
          "name": "number-members",
          "title": "Number of members",
          "inputType": "number"
        },
        {
          "type": "text",
          "name": "number-employees",
          "startWithNewLine": false,
          "title": "Number of employees",
          "inputType": "number"
        },
        {
          "type": "paneldynamic",
          "name": "board-members",
          "title": "Board members or management representatives",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Member {panelIndex}",
          "addPanelText": "Add member",
          "templateElements": [
            {
              "type": "text",
              "name": "name",
              "title": "Name"
            },
            {
              "type": "text",
              "name": "address",
              "title": "Address",
              "startWithNewLine": false
            },
            {
              "type": "text",
              "name": "telephone",
              "title": "Telephone number",
              "inputType": "phone"
            },
            {
              "type": "text",
              "name": "email",
              "title": "Email address",
              "startWithNewLine": false,
              "inputType": "email"
            }
          ]
        }
      ]
    },
    {
      "name": "grant-details",
      "title": "3. Grant Information",
      "elements": [
        {
          "type": "text",
          "name": "grant-details-name",
          "title": "Name of the grant"
        },
        {
          "type": "text",
          "name": "grant-details-reference-number",
          "startWithNewLine": false,
          "title": "Government Offices reference number"
        },
        {
          "type": "text",
          "name": "grant-details-ministry",
          "title": "Ministry responsible for approving the grant (if known)"
        },
        {
          "type": "text",
          "name": "grant-details-amount",
          "startWithNewLine": false,
          "title": "Amount requested"
        }
      ]
    },
    {
      "name": "planned-activities",
      "title": "4. Planned Activities",
      "elements": [
        {
          "type": "comment",
          "name": "purpose",
          "title": "Purpose and objectives of the planned activities"
        },
        {
          "type": "comment",
          "name": "target-groups",
          "title": "Target groups"
        },
        {
          "type": "comment",
          "name": "planned-activities-question",
          "title": "Describe the planned activities"
        },
        {
          "type": "comment",
          "name": "own-contribution",
          "title": "Describe the applicant's own contribution to the activities"
        },
        {
          "type": "comment",
          "name": "need",
          "title": "Explain the need for the planned activities"
        },
        {
          "type": "panel",
          "name": "period",
          "title": "Period during which the activities will be carried out",
          "elements": [
            {
              "type": "text",
              "name": "from",
              "title": "From",
              "inputType": "date"
            },
            {
              "type": "text",
              "name": "to",
              "startWithNewLine": false,
              "title": "To",
              "inputType": "date"
            }
          ]
        },
        {
          "type": "comment",
          "name": "gender",
          "title": "How will gender equality be considered in the planned activities?"
        },
        {
          "type": "paneldynamic",
          "name": "collaborations",
          "title": "Collaborating organizations or institutions (if applicable)",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Collaboration {panelIndex}",
          "addPanelText": "Add collaboration",
          "templateElements": [
            {
              "type": "text",
              "name": "organization",
              "title": "Organization or institution"
            },
            {
              "type": "comment",
              "name": "collaboration-description",
              "title": "Describe the collaboration",
              "rows": 2
            }
          ]
        },
        {
          "type": "comment",
          "name": "part",
          "title": "If only part of the grant is awarded, which activities will still be carried out?"
        }
      ]
    },
    {
      "name": "skills",
      "title": "5. Skills and Experience",
      "elements": [
        {
          "type": "comment",
          "name": "skills-prospects",
          "title": "Describe the applicant's ability to carry out the proposed activities"
        },
        {
          "type": "comment",
          "name": "skills-activities",
          "title": "Describe similar activities that have previously been conducted"
        },
        {
          "type": "file",
          "name": "skills-ani-corruption",
          "title": "Attach the applicant's anti-corruption policy or an equivalent document (if available)",
          "waitForUpload": true
        },
        {
          "type": "file",
          "name": "skills-risk-analysis",
          "startWithNewLine": false,
          "title": "Attach the applicant's risk analysis for the proposed activities (if available)",
          "waitForUpload": true
        },
        {
          "type": "comment",
          "name": "skills-other-information",
          "title": "Other information that supports the applicant's ability to carry out the activities"
        }
      ]
    },
    {
      "name": "references",
      "title": "6. References",
      "elements": [
        {
          "type": "paneldynamic",
          "name": "references-panel",
          "title": "References",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Reference {panelIndex}",
          "addPanelText": "Add reference",
          "templateElements": [
            {
              "type": "text",
              "name": "name",
              "title": "Name"
            },
            {
              "type": "text",
              "name": "address",
              "title": "Address",
              "startWithNewLine": false
            },
            {
              "type": "text",
              "name": "telephone",
              "title": "Telephone number",
              "inputType": "phone"
            },
            {
              "type": "text",
              "name": "email",
              "title": "Email address",
              "startWithNewLine": false,
              "inputType": "email"
            }
          ]
        }
      ]
    },
    {
      "name": "other-information",
      "title": "7. Other Information",
      "elements": [
        {
          "type": "comment",
          "name": "other-information-box",
          "title": "Provide any additional information that may support this application"
        }
      ]
    }
  ],
  "questionsOnPageMode": "singlePage",
  "headerView": "advanced"
};
```

### `src/main.ts`

```ts
import { createApp } from "vue";
import App from "./App.vue";

const app = createApp(App);
app.mount("#app");
```

### `src/shims-vue.d.ts`

```ts
/* eslint-disable */
declare module "*.vue" {
    import type { DefineComponent } from "vue"
    const component: DefineComponent<{}, {}, any>
    export default component
}
```

### `src/theme.ts`

```ts
export const themeJson = {};
```

### `.eslintrc.js`

```js
module.exports = {
    root: true,
    env: {
        node: true
    },
    extends: [
        "plugin:vue/vue3-essential",
        "eslint:recommended",
        "@vue/typescript/recommended",
        "@vue/prettier",
        "@vue/prettier/@typescript-eslint"
    ],
    parserOptions: {
        ecmaVersion: 2020
    },
    rules: {
        "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
        "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
    },
    overrides: [
        {
            files: [
                "**/__tests__/*.{j,t}s?(x)",
                "**/tests/unit/**/*.spec.{j,t}s?(x)"
            ],
            env: {
                jest: true
            }
        }
    ]
};
```

### `babel.config.js`

```js
module.exports = {
  presets: ["@vue/cli-plugin-babel/preset"]
};
```

### `package.json`

```json
{
  "name": "surveyjs-library-vue3",
  "version": "0.1.0",
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "tslib": "2.6.1",
    "vue": "^3.4.1",
    "survey-core": "latest",
    "survey-pdf": "latest",
    "survey-vue3-ui": "latest",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^2.33.0",
    "@typescript-eslint/parser": "^2.33.0",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-pwa": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-typescript": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^5.0.2",
    "@vue/test-utils": "^2.0.0-0",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-vue": "^7.0.0-0",
    "node-sass": "^4.12.0",
    "prettier": "^1.19.1",
    "sass-loader": "^8.0.2",
    "typescript": "~3.9.3"
  }
}
```

### `tsconfig.json`

```json
{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": [
      "webpack-env",
      "jest"
    ],
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": [
    "node_modules"
  ]
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/angular.md)
- [React](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/reactjs.md)
- [jQuery](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/jquery.md)
- [Vanilla JS](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/vanillajs.md)
