diff --git a/apps/client/src/ee/pdf-export/pdf-render-page.tsx b/apps/client/src/ee/pdf-export/pdf-render-page.tsx index 8705f9b6c..0f13cb71b 100644 --- a/apps/client/src/ee/pdf-export/pdf-render-page.tsx +++ b/apps/client/src/ee/pdf-export/pdf-render-page.tsx @@ -58,6 +58,7 @@ export default function PdfRenderPage() { title={data.title} content={data.content} pageId={data.pageId} + printMode /> ); diff --git a/apps/client/src/features/editor/readonly-page-editor.tsx b/apps/client/src/features/editor/readonly-page-editor.tsx index cd4878a9b..4b28bec9d 100644 --- a/apps/client/src/features/editor/readonly-page-editor.tsx +++ b/apps/client/src/features/editor/readonly-page-editor.tsx @@ -15,6 +15,7 @@ interface PageEditorProps { title: string; content: any; pageId?: string; + printMode?: boolean; /** * When rendering inside a public share, pass the share's id (or key). Lookups * for transclusion content then resolve against the share graph instead of @@ -28,6 +29,7 @@ export default function ReadonlyPageEditor({ title, content, pageId, + printMode = false, shareId, }: PageEditorProps) { const [, setReadOnlyEditor] = useAtom(readOnlyEditorAtom); @@ -48,8 +50,12 @@ export default function ReadonlyPageEditor({ }, []); const extensions = useMemo(() => { + const excludedExtensions = new Set([ + "uniqueID", + ...(printMode ? ["tableHeaderPin", "tableReadonlySort"] : []), + ]); const filteredExtensions = mainExtensions.filter( - (ext) => ext.name !== "uniqueID", + (ext) => !excludedExtensions.has(ext.name), ); return [ @@ -59,7 +65,7 @@ export default function ReadonlyPageEditor({ updateDocument: false, }), ]; - }, []); + }, [printMode]); const titleExtensions = [ Document.extend({ diff --git a/apps/client/src/features/editor/styles/table.css b/apps/client/src/features/editor/styles/table.css index ac5b91d4c..32a427936 100644 --- a/apps/client/src/features/editor/styles/table.css +++ b/apps/client/src/features/editor/styles/table.css @@ -163,8 +163,13 @@ @media print { .tableWrapper.tableHeaderPinned table tr:first-child { - position: static; - transform: none; + position: static !important; + top: auto !important; + transform: none !important; + } + + .tableReadonlySortChevron { + display: none !important; } } @@ -268,4 +273,4 @@ .prosemirror-dropcursor-inline { display: none; } -} \ No newline at end of file +}