Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
3102a879
Commit
3102a879
authored
Sep 08, 2025
by
weiw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:隐藏工具栏的相关配置
parent
eb51f0f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/components/FilePreviewModal/PdfPreview.tsx
+12
-7
No files found.
src/components/FilePreviewModal/PdfPreview.tsx
View file @
3102a879
...
...
@@ -8,12 +8,7 @@ interface PdfPreviewProps {
onError
?:
(
error
:
any
)
=>
void
}
export
const
PdfPreview
:
React
.
FC
<
PdfPreviewProps
>
=
({
src
,
className
=
''
,
onLoaded
,
onError
,
})
=>
{
export
const
PdfPreview
:
React
.
FC
<
PdfPreviewProps
>
=
({
src
,
className
=
''
,
onLoaded
,
onError
})
=>
{
const
handleLoad
=
()
=>
{
onLoaded
?.()
}
...
...
@@ -22,11 +17,21 @@ export const PdfPreview: React.FC<PdfPreviewProps> = ({
onError
?.(
new
Error
(
'PDF加载失败'
))
}
// 完整的PDF参数配置
// toolbar=0 隐藏工具栏 0=隐藏, 1=显示
// navpanes=0 隐藏导航面板 0=隐藏, 1=显示
// scrollbar=0 隐藏滚动条 0=隐藏, 1=显示
// statusbar=0 隐藏状态栏 0=隐藏, 1=显示
// messages=0 隐藏消息栏 0=隐藏, 1=显示
// view=FitH 设置视图模式 FitH=水平适应, FitV=垂直适应
// zoom=page-width 设置缩放模式 page-width=页面宽度
const
pdfUrl
=
`
${
src
}
#toolbar=0&navpanes=0&scrollbar=0&view=FitH&statusbar=0&messages=0&zoom=page-width`
return
(
<
div
className=
{
`${className} h-full flex flex-col`
}
>
<
div
className=
"flex-grow overflow-hidden bg-gray-100"
>
<
embed
src=
{
src
}
src=
{
pdfUrl
}
type=
"application/pdf"
className=
"w-full h-full border-0"
onLoad=
{
handleLoad
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment