Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White ago
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kuxulei
PDF Viewer Scanner White ago
Commits
6698b57f
Commit
6698b57f
authored
Dec 19, 2024
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修复】修复pdf加锁问题
parent
0005e831
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
PdfActivity.kt
...base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
+3
-3
PdfBoxUtils.kt
...base/pdfviewerscannerwhite/ui/document/pdf/PdfBoxUtils.kt
+4
-0
PdfPagerAdapter.kt
.../pdfviewerscannerwhite/ui/document/pdf/PdfPagerAdapter.kt
+1
-7
PdfSplitActivity.kt
...pdfviewerscannerwhite/ui/document/pdf/PdfSplitActivity.kt
+1
-2
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
View file @
6698b57f
...
...
@@ -121,11 +121,11 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
SearchTaskResult
.
set
(
null
)
if
(
muPDFCore
?.
needsPassword
()
==
true
)
{
val
pwd
=
intent
.
extras
?.
getString
(
"pwd"
)
?:
""
//
val pwd = intent.extras?.getString("pwd") ?: ""
val
flag
=
muPDFCore
?.
authenticatePassword
(
pwd
)
?:
false
if
(
flag
)
{
pdfPresenter
.
password
=
pwd
pdfPageAdapter
.
setPassword
(
pwd
)
//
pdfPageAdapter.setPassword(pwd)
createPdfUI
()
muPDFCore
?.
countPages
()
?.
let
{
//pdfPresenter.iniPdfPage(it)
...
...
@@ -351,7 +351,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
private
fun
initAdapter
()
{
pdfPageAdapter
=
PdfPagerAdapter
(
path
,
uri
){
pdfPageAdapter
=
PdfPagerAdapter
(
path
,
uri
,
mPassword
=
pwd
){
iniSetVerticalSeekbar
(
it
)
}
pdfPageAdapter
.
clickAction
=
{
pageIndex
->
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfBoxUtils.kt
View file @
6698b57f
...
...
@@ -15,6 +15,7 @@ import com.tom_roush.pdfbox.pdmodel.PDPage
import
com.tom_roush.pdfbox.pdmodel.PDPageContentStream
import
com.tom_roush.pdfbox.pdmodel.common.PDRectangle
import
com.tom_roush.pdfbox.pdmodel.encryption.AccessPermission
import
com.tom_roush.pdfbox.pdmodel.encryption.InvalidPasswordException
import
com.tom_roush.pdfbox.pdmodel.encryption.StandardProtectionPolicy
import
com.tom_roush.pdfbox.pdmodel.graphics.image.PDImageXObject
import
com.tom_roush.pdfbox.rendering.ImageType
...
...
@@ -90,6 +91,9 @@ object PdfBoxUtils {
state
=
0
}
}
}
catch
(
e
:
InvalidPasswordException
){
e
.
printStackTrace
()
state
=
1
}
catch
(
e
:
IOException
)
{
e
.
printStackTrace
()
state
=
-
1
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfPagerAdapter.kt
View file @
6698b57f
...
...
@@ -27,10 +27,10 @@ class PdfPagerAdapter(
val
uri
:
String
?
=
null
,
val
itemLayout
:
Int
=
R
.
layout
.
item_pdf_pager
,
private
val
previewScale
:
Float
=
1f
,
private
val
mPassword
:
String
?
=
null
,
initCallBack
:
((
itemCount
:
Int
)
->
Unit
)?
=
null
)
:
BaseQuickAdapter
<
PdfPageBean
,
PdfPagerAdapter
.
PdfPagerViewHolder
>()
{
var
mPassword
:
String
?
=
null
var
selectAction
:
((
enable
:
Boolean
,
allSelect
:
Boolean
)
->
Unit
)?
=
null
var
clickAction
:
((
pageIndex
:
Int
)
->
Unit
)?
=
null
...
...
@@ -183,12 +183,6 @@ class PdfPagerAdapter(
notifyDataSetChanged
()
}
@SuppressLint
(
"NotifyDataSetChanged"
)
fun
setPassword
(
password
:
String
)
{
mPassword
=
password
notifyDataSetChanged
()
}
fun
release
()
{
scope
.
cancel
()
pdfRender
=
null
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfSplitActivity.kt
View file @
6698b57f
...
...
@@ -70,8 +70,7 @@ class PdfSplitActivity : BaseActivity<ActivityPdfSplitBinding>(), PdfView {
}
private
fun
initAdapter
()
{
pdfPagerAdapter
=
PdfPagerAdapter
(
path
,
null
,
R
.
layout
.
item_pdf_pager_split
,
1.5f
)
pdfPagerAdapter
.
mPassword
=
pwd
pdfPagerAdapter
=
PdfPagerAdapter
(
path
,
null
,
R
.
layout
.
item_pdf_pager_split
,
1.5f
,
mPassword
=
pwd
)
pdfPagerAdapter
.
selectAction
=
{
enable
,
allSelect
->
binding
.
tvBtnSplit
.
isEnabled
=
enable
binding
.
ivSelector
.
isSelected
=
allSelect
...
...
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