pdfsvex logo

PDF generation, made easy

Visit kit.svelte.dev to read the documentation

Version Downloads Documentation License

Table of Contents

1 Introduction

You need to supply content

2 Motivation

You need to supply content

3 Getting started

You need to supply content

4 Packages

4.1 @pdfsvex/pdfsvex

Motivation
Version Downloads Documentation License

Easily create table of contents.

Component Slot Html Css Description
PdfDocument The main pdf generation wrapper
DynamicComponent Dynamic components that need to be created after the pagination

4.1.1 Component: PdfDocument

Main PDF Document Wrapper

Name Description Optional Default
options The main options object
style The document size. One of A3, A4, A5, letter, legal A4
landscape If the documents should be rendered in landscape false
numbered Defines if the chapter should be numbered, and if the number should be increased true

4.1.2 Component: DynamicComponent

Dynamic components that need to be created after the pagination

Name Description Optional Default
componentId The unique id of this component
attributes The properties that should be passed to the dynamic component {}

4.2 @pdfsvex/table-of-contents

Version Downloads Documentation License

Easily create table of contents.

Component Slot Html Css Description
Chapter Bare logic for adding chapters
ChapterReference Bare logic referencing a chapter
TableOfContents Bare logic for displaying a table of contents
ChapterDefault Implementation of Chapter, contains elements and styling
ChapterReferenceDefault Implementation of ChapterReference, contains elements and styling
TableOfContentsDefault Implementation of TableOfContents, contains elements and styling

4.2.1 Component: Chapter

Implements logic for creating custom styled chapter components.

Name Description Optional Default
name The name or desceiption of the chapter
key Defines the unique key of the chapter. This key is used as an internal identifier. Aditionally this property could be used to create html ids
includeInTableOfContents Defines if the chapter should be visible in the table of contents true
numbered Defines if the chapter should be numbered, and if the number should be increased true

4.2.2 Component: ChapterReference

Implements logic for referencing another chapter

Name Description Optional Default
key The unique key of the chapter created during the initialization of the chapter

4.2.3 Component: TableOfContents

Implements logic for creating a table of contents

Name Description Optional Default
chapters (internal) A filtered list of chapters to display in table of contents undefined

4.2.4 Component: ChapterDefault

Implements logic, html and styling for creating a table of contents

Name Description Optional Default
name The name or desceiption of the chapter
key Defines the unique key of the chapter. This key is used as an internal identifier. Aditionally this property could be used to create html ids
includeInTableOfContents Defines if the chapter should be visible in the table of contents true
numbered Defines if the chapter should be numbered, and if the number should be increased true

4.2.5 Component: ChapterReferenceDefault

Implements logic, html and styling for referencing another chapter

Name Description Optional Default
key The unique key of the chapter created during the initialization of the chapter

4.2.6 Component: TableOfContentsDefaults

Implements logic, html and styling for creating a table of contents

Name Description Optional Default
title Heading displayed above the table of contents Table of Contents
indentWidthInPx Number of pixels to intend each child elments 15
startSizePt Start size of the font in pt. Reduced by "decrementSize" for each child. 14
decrementSize Number "startSizePt" will be reduced by for each child 1
depth (internal) the current depth count 0
chapters (internal) A filtered list of chapters to display in table of contents undefined
Loading...