Composables

usePdfKitRotation

Document rotation.

Manages document rotation.

Usage

const {
  rotation,
  rotateClockwise,
  rotateCounterclockwise,
  setRotation,
} = usePdfKitRotation()

Options

usePdfKitRotation({
  initialRotation: 0,
})
OptionTypeDefaultDescription
initialRotationnumber0Initial rotation in degrees

Return Values

PropertyTypeDescription
rotationRef<number>Current rotation (0, 90, 180, 270)
rotateClockwise() => voidRotate +90°
rotateCounterclockwise() => voidRotate -90°
setRotation(degrees: number) => voidSet 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>
Copyright © 2026