Official Vue starter template for InkLayer — a PDF annotation SDK built on PDF.js.
This project demonstrates how to quickly integrate InkLayer into a Vue 3 application.
👉 Live Demo: https://inklayer.dev
👉 Vue SDK: https://github.com/Laomai-codefee/inklayer-vue
👉 React SDK: https://github.com/Laomai-codefee/inklayer-react
npm install
or
pnpm installnpm run dev
or
pnpm devhttp://localhost:5173- PDF rendering based on PDF.js
- Annotation system (highlight, selection, etc.)
- Annotation sidebar
- Save annotation output
- Vue plugin integration
import { createApp } from 'vue'
import { inklayerVuePlugin } from 'inklayer-vue'
import App from './App.vue'
const app = createApp(App)
app.use(inklayerVuePlugin)
app.mount('#app')<script setup lang="ts">
import { PdfAnnotator } from 'inklayer-vue'
import 'inklayer-vue/style'
</script>
<template>
<PdfAnnotator
url="https://inklayer.dev/inklayer-demo.pdf"
:user="{ id: 'demo', name: 'Demo User' }"
:layoutStyle="{ width: '100vw', height: '100vh' }"
:defaultShowAnnotationsSidebar="true"
@save="(annotations) => {
console.log('saved:', annotations)
}"
/>
</template>- Load PDF via PDF.js
- Render annotation layer on top of PDF pages
- User creates highlights / comments
- SDK emits structured annotation data via onSave
onSave returns structured annotation data:
[
{
id: "annotation-id",
kind: "text-markup",
target: { ... },
payload: { ... },
meta: { ... }
}
]- Stored in database
- Re-rendered later
- Synced across systems
Vue version requires plugin initialization:
app.use(inklayerVuePlugin)Without this, annotation system will not initialize correctly.
- Quick SDK evaluation
- Integration testing
- Reference implementation
- Project bootstrap
- Docs: https://inklayer.dev/docs
- React SDK: https://github.com/Laomai-codefee/inklayer-react
- Vue SDK: https://github.com/Laomai-codefee/inklayer-vue
- React Starter: https://github.com/Laomai-codefee/inklayer-react-starter