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
2019-02-17 11:58:37 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
41411fbc9c9a9a6d1c7d0560ec20030a939abf57
41411fbc
1 parent
af108760
Add documentation
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
0 deletions
printing/CHANGELOG.md
printing/lib/src/asset_utils.dart
printing/lib/src/printing.dart
printing/lib/src/widgets.dart
printing/CHANGELOG.md
View file @
41411fb
# 1.3.4
*
Fix dart lint warnings
*
Add documentation
# 1.3.3
*
Update Readme
...
...
printing/lib/src/asset_utils.dart
View file @
41411fb
...
...
@@ -16,6 +16,8 @@
part of
printing
;
/// Loads an image from a Flutter [ui.Image]
/// into a [PdfImage] instance
Future
<
PdfImage
>
pdfImageFromImage
(
{
@required
PdfDocument
pdf
,
@required
ui
.
Image
image
})
async
{
final
ByteData
bytes
=
...
...
@@ -27,6 +29,8 @@ Future<PdfImage> pdfImageFromImage(
height:
image
.
height
);
}
/// Loads an image from a Flutter [ImageProvider]
/// into a [PdfImage] instance
Future
<
PdfImage
>
pdfImageFromImageProvider
(
{
@required
PdfDocument
pdf
,
@required
ImageProvider
image
,
...
...
printing/lib/src/printing.dart
View file @
41411fb
...
...
@@ -41,6 +41,9 @@ mixin Printing {
}
}
/// Prints a Pdf document to a local printer using the platform UI
/// the Pdf document is re-built in a [LayoutCallback] each time the
/// user changes a setting like the page format or orientation.
static
Future
<
void
>
layoutPdf
(
{
@required
LayoutCallback
onLayout
,
String
name
=
'Document'
})
async
{
_onLayout
=
onLayout
;
...
...
@@ -49,6 +52,7 @@ mixin Printing {
await
_channel
.
invokeMethod
<
void
>(
'printPdf'
,
params
);
}
/// Prints a [PdfDocument] or a pdf stream to a local printer using the platform UI
@deprecated
static
Future
<
void
>
printPdf
({
PdfDocument
document
,
List
<
int
>
bytes
})
async
{
assert
(
document
!=
null
||
bytes
!=
null
);
...
...
@@ -59,6 +63,7 @@ mixin Printing {
document
!=
null
?
document
.
save
()
:
bytes
);
}
/// Displays a platform popup to share the Pdf document to another application
static
Future
<
void
>
sharePdf
(
{
PdfDocument
document
,
List
<
int
>
bytes
,
Rect
bounds
})
async
{
assert
(
document
!=
null
||
bytes
!=
null
);
...
...
printing/lib/src/widgets.dart
View file @
41411fb
...
...
@@ -17,6 +17,7 @@
part of
printing
;
class
PdfDoc
extends
Document
{
/// Wrapper for a [Document] with zlib compression enabled by default
PdfDoc
({
bool
compress
=
true
})
:
super
(
deflate:
compress
?
zlib
.
encode
:
null
);
}
...
...
Please
register
or
login
to post a comment