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
2021-04-04 10:14:40 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cd06dd312274e992ab757d1c76304f14a80e20ed
cd06dd31
1 parent
8cd1b801
Add ObjectDict
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
17 deletions
pdf/lib/src/pdf/annotation.dart
pdf/lib/src/pdf/catalog.dart
pdf/lib/src/pdf/font.dart
pdf/lib/src/pdf/font_descriptor.dart
pdf/lib/src/pdf/object.dart
pdf/lib/src/pdf/object_dict.dart
pdf/lib/src/pdf/object_stream.dart
pdf/lib/src/pdf/page.dart
pdf/lib/src/pdf/page_list.dart
pdf/lib/src/pdf/signature.dart
pdf/lib/src/pdf/annotation.dart
View file @
cd06dd3
...
...
@@ -25,12 +25,13 @@ import 'font.dart';
import
'graphic_stream.dart'
;
import
'graphics.dart'
;
import
'object.dart'
;
import
'object_dict.dart'
;
import
'page.dart'
;
import
'point.dart'
;
import
'rect.dart'
;
import
'stream.dart'
;
class
PdfAnnot
extends
PdfObject
{
class
PdfAnnot
extends
PdfObject
Dict
{
PdfAnnot
(
this
.
pdfPage
,
this
.
annot
)
:
super
(
pdfPage
.
pdfDocument
,
type:
'/Annot'
)
{
pdfPage
.
annotations
.
add
(
this
);
...
...
pdf/lib/src/pdf/catalog.dart
View file @
cd06dd3
...
...
@@ -19,11 +19,12 @@ import 'data_types.dart';
import
'document.dart'
;
import
'names.dart'
;
import
'object.dart'
;
import
'object_dict.dart'
;
import
'outline.dart'
;
import
'page_list.dart'
;
/// Pdf Catalog object
class
PdfCatalog
extends
PdfObject
{
class
PdfCatalog
extends
PdfObject
Dict
{
/// This constructs a Pdf Catalog object
PdfCatalog
(
PdfDocument
pdfDocument
,
...
...
pdf/lib/src/pdf/font.dart
View file @
cd06dd3
...
...
@@ -19,14 +19,14 @@ import 'dart:convert';
import
'data_types.dart'
;
import
'document.dart'
;
import
'font_metrics.dart'
;
import
'object.dart'
;
import
'object
_dict
.dart'
;
import
'point.dart'
;
import
'stream.dart'
;
import
'type1_font.dart'
;
import
'type1_fonts.dart'
;
/// Pdf font object
abstract
class
PdfFont
extends
PdfObject
{
abstract
class
PdfFont
extends
PdfObject
Dict
{
/// Constructs a [PdfFont]. This will attempt to map the font from a known
/// font name to that in Pdf, defaulting to Helvetica if not possible.
PdfFont
.
create
(
PdfDocument
pdfDocument
,
{
required
this
.
subtype
})
...
...
pdf/lib/src/pdf/font_descriptor.dart
View file @
cd06dd3
...
...
@@ -16,11 +16,12 @@
import
'data_types.dart'
;
import
'object.dart'
;
import
'object_dict.dart'
;
import
'object_stream.dart'
;
import
'ttffont.dart'
;
/// Font descriptor object
class
PdfFontDescriptor
extends
PdfObject
{
class
PdfFontDescriptor
extends
PdfObject
Dict
{
/// Create a Font descriptor object
PdfFontDescriptor
(
this
.
ttfFont
,
...
...
pdf/lib/src/pdf/object.dart
View file @
cd06dd3
...
...
@@ -26,14 +26,10 @@ class PdfObject {
/// Pdf Object Type
PdfObject
(
this
.
pdfDocument
,
{
String
?
type
,
//
String? type,
this
.
objgen
=
0
,
int
?
objser
,
})
:
objser
=
objser
??
pdfDocument
.
genSerial
()
{
if
(
type
!=
null
)
{
params
[
'/Type'
]
=
PdfName
(
type
);
}
pdfDocument
.
objects
.
add
(
this
);
}
...
...
pdf/lib/src/pdf/object_dict.dart
0 → 100644
View file @
cd06dd3
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
'data_types.dart'
;
import
'document.dart'
;
import
'object.dart'
;
/// Object with a PdfDict used in the PDF file
class
PdfObjectDict
extends
PdfObject
{
/// This is usually called by extensors to this class, and sets the
/// Pdf Object Type
PdfObjectDict
(
PdfDocument
pdfDocument
,
{
String
?
type
,
int
objgen
=
0
,
int
?
objser
,
})
:
super
(
pdfDocument
,
objgen:
objgen
,
objser:
objser
)
{
if
(
type
!=
null
)
{
params
[
'/Type'
]
=
PdfName
(
type
);
}
}
/// This is the object parameters.
final
PdfDict
params
=
PdfDict
();
@override
String
toString
()
=>
'
$runtimeType
$params
'
;
}
...
...
pdf/lib/src/pdf/object_stream.dart
View file @
cd06dd3
...
...
@@ -19,11 +19,11 @@ import 'dart:typed_data';
import
'ascii85.dart'
;
import
'data_types.dart'
;
import
'document.dart'
;
import
'object.dart'
;
import
'object
_dict
.dart'
;
import
'stream.dart'
;
/// Stream Object
class
PdfObjectStream
extends
PdfObject
{
class
PdfObjectStream
extends
PdfObject
Dict
{
/// Constructs a stream object to store some data
PdfObjectStream
(
PdfDocument
pdfDocument
,
{
...
...
pdf/lib/src/pdf/page.dart
View file @
cd06dd3
...
...
@@ -19,7 +19,7 @@ import 'data_types.dart';
import
'document.dart'
;
import
'graphic_stream.dart'
;
import
'graphics.dart'
;
import
'object.dart'
;
import
'object
_dict
.dart'
;
import
'object_stream.dart'
;
import
'page_format.dart'
;
...
...
@@ -39,7 +39,7 @@ enum PdfPageRotation {
}
/// Page object, which will hold any contents for this page.
class
PdfPage
extends
PdfObject
with
PdfGraphicStream
{
class
PdfPage
extends
PdfObject
Dict
with
PdfGraphicStream
{
/// This constructs a Page object, which will hold any contents for this
/// page.
PdfPage
(
...
...
pdf/lib/src/pdf/page_list.dart
View file @
cd06dd3
...
...
@@ -16,11 +16,11 @@
import
'data_types.dart'
;
import
'document.dart'
;
import
'object.dart'
;
import
'object
_dict
.dart'
;
import
'page.dart'
;
/// PdfPageList object
class
PdfPageList
extends
PdfObject
{
class
PdfPageList
extends
PdfObject
Dict
{
/// This constructs a [PdfPageList] object.
PdfPageList
(
PdfDocument
pdfDocument
)
:
super
(
pdfDocument
,
type:
'/Pages'
);
...
...
pdf/lib/src/pdf/signature.dart
View file @
cd06dd3
...
...
@@ -17,11 +17,12 @@
import
'data_types.dart'
;
import
'document.dart'
;
import
'object.dart'
;
import
'object_dict.dart'
;
import
'stream.dart'
;
enum
PdfSigFlags
{
signaturesExist
,
appendOnly
}
class
PdfSignature
extends
PdfObject
{
class
PdfSignature
extends
PdfObject
Dict
{
PdfSignature
(
PdfDocument
pdfDocument
,
{
required
this
.
crypto
,
...
...
Please
register
or
login
to post a comment