Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖文锋
/
pdfPreview
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
49ca98e3
authored
Jun 20, 2020
by
xiaowenfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把PDF预览改为不渲染html的模式
parent
231d2d0d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
src/App.vue
src/App.vue
View file @
49ca98e3
...
@@ -172,6 +172,7 @@ export default {
...
@@ -172,6 +172,7 @@ export default {
startTime
:
null
,
startTime
:
null
,
scale
:
2
,
// 缩放比例
scale
:
2
,
// 缩放比例
borderSize
:
9
,
// viewerContainer容器border大小
borderSize
:
9
,
// viewerContainer容器border大小
shouldRenderHtml
:
false
,
// pdf预览时是否需要渲染成html
pageSize
:
1
,
pageSize
:
1
,
selected
:
2
,
selected
:
2
,
pdfUrl
:
""
,
pdfUrl
:
""
,
...
@@ -227,6 +228,7 @@ export default {
...
@@ -227,6 +228,7 @@ export default {
viewport
viewport
);
);
this
.
renderCanvas
(
bufferCanvas
,
viewport
,
page
);
this
.
renderCanvas
(
bufferCanvas
,
viewport
,
page
);
if
(
this
.
shouldRenderHtml
)
{
let
textContent
=
await
page
.
getTextContent
();
let
textContent
=
await
page
.
getTextContent
();
this
.
renderHtml
(
this
.
renderHtml
(
textLayerDiv
,
textLayerDiv
,
...
@@ -236,6 +238,7 @@ export default {
...
@@ -236,6 +238,7 @@ export default {
bodyHeight
,
bodyHeight
,
textContent
textContent
);
);
}
},
},
initPage
(
page
,
viewport
)
{
initPage
(
page
,
viewport
)
{
$
(
"#page"
).
css
(
"height"
,
$
(
"body"
).
height
()
-
$
(
".toolbar"
).
height
());
$
(
"#page"
).
css
(
"height"
,
$
(
"body"
).
height
()
-
$
(
".toolbar"
).
height
());
...
...
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