-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
388 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
import { PropTable } from "../../../src/components/PropsTable"; | ||
|
||
# PdfHeader & PdfFooter | ||
|
||
Implemented using React Portals, you can define static/dynamic header and footer using `<PdfHeader>` and `<PdfFooter>`. | ||
|
||
## PdfHeader Props | ||
|
||
<PropTable name="PdfHeader" /> | ||
|
||
## PdfFooter Props | ||
|
||
<PropTable name="PdfFooter" /> | ||
|
||
## Example | ||
|
||
```tsx twoslash | ||
import { PdfHeader, PdfFooter } from "react-pdfmake-reconciler"; | ||
|
||
const staticHeader = ( | ||
<PdfHeader> | ||
<pdf-text>Hello world!</pdf-text> | ||
</PdfHeader> | ||
); | ||
|
||
const dynamicFooter = ( | ||
<PdfFooter> | ||
{(currentPage, pageCount, pageSize) => ( | ||
<pdf-text> | ||
Page {currentPage} / {pageCount} | ||
</pdf-text> | ||
)} | ||
</PdfFooter> | ||
); | ||
``` | ||
|
||
## Regarding React Context | ||
|
||
The way how dynamic content is that the renderer statically renders the function separately, so Context doesn't | ||
penetrate into dynamic content, just like [PdfRenderer](../util-components/pdf-preview.mdx#regarding-react-context). | ||
See also for workaround. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.