Composables
usePdfKitRotation
Document rotation.
Manages document rotation.
Usage
const {
rotation,
rotateClockwise,
rotateCounterclockwise,
setRotation,
} = usePdfKitRotation()
Options
usePdfKitRotation({
initialRotation: 0,
})
| Option | Type | Default | Description |
|---|---|---|---|
initialRotation | number | 0 | Initial rotation in degrees |
Return Values
| Property | Type | Description |
|---|---|---|
rotation | Ref<number> | Current rotation (0, 90, 180, 270) |
rotateClockwise | () => void | Rotate +90° |
rotateCounterclockwise | () => void | Rotate -90° |
setRotation | (degrees: number) => void | Set rotation to a specific angle |
Example
<template>
<div class="flex items-center gap-2">
<UButton @click="rotateCounterclockwise">
<UIcon name="i-lucide-rotate-ccw" />
</UButton>
<span>{{ rotation }}°</span>
<UButton @click="rotateClockwise">
<UIcon name="i-lucide-rotate-cw" />
</UButton>
<UButton @click="setRotation(0)">Reset</UButton>
</div>
</template>
<script setup>
const {
rotation,
rotateClockwise,
rotateCounterclockwise,
setRotation
} = usePdfKitRotation()
</script>