# pdf LLMs.txt > 供 LLM 快速理解 `@flatbiz/antd/pdf` 的使用方式。 ## 模块定位 pdf预览 ## 导入方式 ```ts import { Pdf } from '@flatbiz/antd/pdf'; // 也可以从主入口导入:import { ... } from '@flatbiz/antd'; ``` ## 公开导出 - `PdfDocument` - `Pdf` - pdf预览 - `PdfPage` ## 依赖的 antd 能力 `Result`、`Spin` ## Props / 配置要点 ### CtxProps - `getPdfInstance`(必填):: () => any ### PdfProps - `pdfUrl`(必填):: string - `onLoadError`(可选):: (error: any) => void - `onLoadSuccess`(可选):: (pdfInstance: any) => void - `children`(必填):: ReactNode - `error`(可选):: ReactElement | ((error) => ReactElement) - `className`(可选):: string ### PdfProps - `onRenderSuccess`(可选):: (pageInstance: any, pdfInstance: any) => void - `onRenderError`(可选):: (error: any, pdfInstance: any) => void - `width`(可选):: number;pdf page宽度,高度根据比例适配 - `scale`(可选):: number;缩放比例,默认值:1,配置此参数后 width 属性失效,例如:1、0.6、0.8 - `gap`(可选):: number;pdf页面上下之间的间隙,默认值10 - `pageNumber`(必填):: number;页码 - `children`(可选):: ReactNode - `onClick`(可选):: (e) => void - `className`(可选):: string - `style`(可选):: CSSProperties ## 使用规则与行为 - pdf预览 - pdf page宽度,高度根据比例适配 - 缩放比例,默认值:1,配置此参数后 width 属性失效,例如:1、0.6、0.8 - pdf页面上下之间的间隙,默认值10 - 页码 ## 基础示例 ```tsx import { Pdf, type CtxProps } from '@flatbiz/antd/pdf'; const props: CtxProps = { // 按业务传入必要参数 }; ; ``` ## 源码索引 - `src/pdf/context.ts` - `src/pdf/document.tsx` - `src/pdf/index.ts` - `src/pdf/page.tsx` ## 给 LLM 的注意事项 - 优先使用 `@flatbiz/antd/pdf` 或主入口 `@flatbiz/antd` 的公开导出,不要引用内部实现文件。 - 当 Props 与 antd 原组件同名能力冲突时,以本模块导出的 Props 类型为准。 - 若文档未覆盖某个边缘参数,请读取上方源码索引中的类型定义和 JSDoc。