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
David PHAM-VAN
2023-03-13 09:11:23 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
daeeedf6f4386e7a25b2996060d42a5f5902d800
daeeedf6
1 parent
75e73686
Add support for deleted objects
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
pdf/CHANGELOG.md
pdf/lib/src/pdf/document.dart
pdf/lib/src/pdf/obj/object.dart
pdf/CHANGELOG.md
View file @
daeeedf
...
...
@@ -8,6 +8,7 @@
-
Improve documentation strings
-
Improve verbose output
-
Import already defined form
-
Add support for deleted objects
## 3.9.0
...
...
pdf/lib/src/pdf/document.dart
View file @
daeeedf
...
...
@@ -35,6 +35,7 @@ import 'obj/page_list.dart';
import
'obj/signature.dart'
;
import
'output.dart'
;
import
'stream.dart'
;
import
'xref.dart'
;
/// PDF version to generate
enum
PdfVersion
{
...
...
@@ -213,7 +214,17 @@ class PdfDocument {
// Write each object to the [PdfStream]. We call via the output
// as that builds the xref table
objects
.
forEach
(
pos
.
write
);
objects
.
where
((
e
)
=>
e
.
inUse
).
forEach
(
pos
.
write
);
var
lastFree
=
0
;
for
(
final
obj
in
objects
.
where
((
e
)
=>
!
e
.
inUse
))
{
pos
.
xref
.
add
(
PdfXref
(
obj
.
objser
,
lastFree
,
generation:
obj
.
objgen
,
type:
PdfCrossRefEntryType
.
free
,
));
lastFree
=
obj
.
objser
;
}
// Finally close the output, which writes the xref table.
await
pos
.
close
();
...
...
pdf/lib/src/pdf/obj/object.dart
View file @
daeeedf
...
...
@@ -46,6 +46,8 @@ abstract class PdfObject<T extends PdfDataType> with PdfDiagnostic {
/// This allows any Pdf object to refer to the document being constructed.
final
PdfDocument
pdfDocument
;
var
inUse
=
true
;
/// Writes the object to the output stream.
void
write
(
PdfStream
os
)
{
prepare
();
...
...
Please
register
or
login
to post a comment