Export a Plate document to a file.

Loading...
components/demo.tsx
'use client';

import * as React from 'react';

import { Plate, usePlateEditor } from 'platejs/react';

import { EditorKit } from '@/components/editor/editor-kit';
import { Editor, EditorContainer } from '@/components/ui/editor';

import { DEMO_VALUES } from './values/demo-values';

export default function Demo({ id }: { id: string }) {
  const editor = usePlateEditor({
    plugins: EditorKit,
    value: DEMO_VALUES[id],
  });

  return (
    <Plate editor={editor}>
      <EditorContainer variant="demo">
        <Editor />
      </EditorContainer>
    </Plate>
  );
}

Features

  • Export editor content to:
  • Client-side export with no server dependencies

Usage

Install the Export Toolbar Button component.

Plate Plus

  • Server-side PDF export:
    • High-quality PDF generation
    • Custom fonts and styling
    • Headers and footers
    • Page numbers
    • Font selectable
  • Advanced export options:
    • Paper size selection
    • Margin controls
    • Orientation settings
    • Compression level

Try it out with our server-side PDF export: