-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
197 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
{ | ||
"name": "nuxt-pdfeasy", | ||
"sideEffects": false, | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Novout", | ||
"url": "https://github.com/Novout" | ||
}, | ||
"version": "1.2.1", | ||
"repository": "https://github.com/betterwrite/nuxt-pdfeasy", | ||
"description": "A PDF document generator to your Nuxt application.", | ||
"engines": { | ||
"node": ">=14.16" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/betterwrite/nuxt-pdfeasy/issues" | ||
}, | ||
"keywords": [ | ||
"pdfkit", | ||
"pdf", | ||
"typescript", | ||
"javascript", | ||
"printing", | ||
"nuxt3" | ||
], | ||
"license": "MIT", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./dist/module.mjs", | ||
"require": "./dist/module.cjs" | ||
} | ||
}, | ||
"main": "./dist/module.cjs", | ||
"types": "./dist/types.d.ts", | ||
"files": [ | ||
"dist", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"build:prod": "pnpm run set", | ||
"build": "pnpm run set", | ||
"prepack": "pnpm run set", | ||
"set": "nuxi prepare && nuxt-module-build && nuxi prepare playground", | ||
"dev": "nuxi dev playground", | ||
"dev:build": "nuxi build playground", | ||
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground" | ||
}, | ||
"dependencies": { | ||
"@nuxt/kit": "^3.5.3", | ||
"pdfeasy": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/module-builder": "^0.4.0", | ||
"@nuxt/schema": "^3.5.3", | ||
"@nuxtjs/eslint-config-typescript": "^12.0.0", | ||
"@types/node": "^18.11.9", | ||
"eslint": "^8.42.0", | ||
"nuxt": "^3.5.3" | ||
} | ||
} | ||
{ | ||
"name": "nuxt-pdfeasy", | ||
"sideEffects": false, | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Novout", | ||
"url": "https://github.com/Novout" | ||
}, | ||
"version": "1.2.1", | ||
"repository": "https://github.com/betterwrite/nuxt-pdfeasy", | ||
"description": "A PDF document generator to your Nuxt application.", | ||
"engines": { | ||
"node": ">=14.16" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/betterwrite/nuxt-pdfeasy/issues" | ||
}, | ||
"keywords": [ | ||
"pdfkit", | ||
"pdf", | ||
"typescript", | ||
"javascript", | ||
"printing", | ||
"nuxt3" | ||
], | ||
"license": "MIT", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./dist/module.mjs", | ||
"require": "./dist/module.cjs" | ||
} | ||
}, | ||
"main": "./dist/module.cjs", | ||
"types": "./dist/types.d.ts", | ||
"files": [ | ||
"dist", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"build:prod": "pnpm run set", | ||
"build": "pnpm run set", | ||
"prepack": "pnpm run set", | ||
"set": "nuxi prepare && nuxt-module-build && nuxi prepare playground", | ||
"dev": "nuxi dev playground", | ||
"dev:build": "nuxi build playground", | ||
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground" | ||
}, | ||
"dependencies": { | ||
"@nuxt/kit": "^3.5.3", | ||
"pdfeasy": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/module-builder": "^0.4.0", | ||
"@nuxt/schema": "^3.5.3", | ||
"@nuxtjs/eslint-config-typescript": "^12.0.0", | ||
"@types/node": "^18.11.9", | ||
"eslint": "^8.42.0", | ||
"nuxt": "^3.5.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
<template> | ||
<iframe id="pdf" /> | ||
</template> | ||
|
||
<script setup> | ||
import { useNuxtApp } from '#app'; | ||
const { $pdf } = useNuxtApp() | ||
$pdf.new({ | ||
plugins: [ | ||
{ | ||
page: [ | ||
// simple counter footer | ||
({ Text }, context, current, total) => { | ||
// render in every page | ||
Text(`${current}/${total}`, { fontSize: 20 }, { | ||
x: context.width / 2, | ||
y: context.height - context.margins.bottom | ||
}) | ||
}, | ||
// simple header | ||
({ Text }, context, current, total) => { | ||
// render in every page | ||
Text('A Simple Header', {}, { | ||
x: context.width / 2, | ||
y: context.margins.top - 20 | ||
}) | ||
} | ||
] | ||
} | ||
] | ||
}) | ||
$pdf.add([ | ||
{ raw: 'Hello NUXT!', text: { fontSize: 22 }}, | ||
]) | ||
$pdf.run().then(blob => { | ||
const iframe = document.querySelector('#pdf') | ||
iframe.src = blob | ||
}).catch((err) => { | ||
console.error(err) | ||
}) | ||
</script> | ||
<template> | ||
<iframe id="pdf" /> | ||
</template> | ||
|
||
<script setup> | ||
import { useNuxtApp } from '#app'; | ||
const { $pdf } = useNuxtApp() | ||
$pdf.new({ | ||
plugins: [ | ||
{ | ||
page: [ | ||
// simple counter footer | ||
({ Text }, context, current, total) => { | ||
// render in every page | ||
Text(`${current}/${total}`, { fontSize: 20 }, { | ||
x: context.width / 2, | ||
y: context.height - context.margins.bottom | ||
}) | ||
}, | ||
// simple header | ||
({ Text }, context, current, total) => { | ||
// render in every page | ||
Text('A Simple Header', {}, { | ||
x: context.width / 2, | ||
y: context.margins.top - 20 | ||
}) | ||
} | ||
] | ||
} | ||
] | ||
}) | ||
$pdf.add([ | ||
{ raw: 'Hello NUXT!', text: { fontSize: 22 }}, | ||
]) | ||
$pdf.run().then(blob => { | ||
const iframe = document.querySelector('#pdf') | ||
iframe.src = blob | ||
}).catch((err) => { | ||
console.error(err) | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.