Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
ilaurillard
2024-07-18 12:51:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-07-18 07:51:51 -0300
Commit
4c3dccfb42b8491698e98adcd9c04d9df967ff65
4c3dccfb
1 parent
c9d09969
fixes display problems (randomly disappearing text) with textfields (#1699)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
pdf/lib/src/pdf/obj/catalog.dart
pdf/lib/src/pdf/obj/catalog.dart
View file @
4c3dccf
...
...
@@ -141,12 +141,25 @@ class PdfCatalog extends PdfObject<PdfDict> {
acroForm
[
'/SigFlags'
]
=
PdfNum
(
pdfDocument
.
sign
?.
flagsValue
??
0
)
|
(
acroForm
[
'/SigFlags'
]
as
PdfNum
?
??
const
PdfNum
(
0
));
final
fields
=
(
acroForm
[
'/Fields'
]
??=
PdfArray
())
as
PdfArray
;
final
fontRefs
=
PdfDict
();
for
(
final
w
in
widgets
)
{
if
(
w
.
annot
is
PdfTextField
)
{
// collect textfield font references
PdfTextField
tf
=
w
.
annot
as
PdfTextField
;
fontRefs
.
addAll
(
PdfDict
.
values
(
{
tf
.
font
.
name
:
tf
.
font
.
ref
()}
));
}
final
ref
=
w
.
ref
();
if
(!
fields
.
values
.
contains
(
ref
))
{
fields
.
add
(
ref
);
}
}
if
(
fontRefs
.
isNotEmpty
)
{
acroForm
[
'/DR'
]
=
PdfDict
.
values
(
// "Document Resources"
{
'/Font'
:
fontRefs
}
);
}
}
}
}
...
...
Please
register
or
login
to post a comment