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
2018-09-09 15:21:58 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1606db8a6e9bedfd5ae907af56e51e9e8f1f473d
1606db8a
1 parent
e8be364e
Change temporary file name
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
printing/android/src/main/java/net/nfet/flutter/printing/PrintingPlugin.java
printing/android/src/main/java/net/nfet/flutter/printing/PrintingPlugin.java
View file @
1606db8
...
...
@@ -82,7 +82,7 @@ public class PrintingPlugin implements MethodCallHandler {
}
}
private
void
printPdf
(
final
byte
[]
badge
Data
)
{
private
void
printPdf
(
final
byte
[]
document
Data
)
{
PrintDocumentAdapter
pda
=
new
PrintDocumentAdapter
()
{
PrintedPdfDocument
mPdfDocument
;
...
...
@@ -93,7 +93,7 @@ public class PrintingPlugin implements MethodCallHandler {
OutputStream
output
=
null
;
try
{
output
=
new
FileOutputStream
(
parcelFileDescriptor
.
getFileDescriptor
());
output
.
write
(
badgeData
,
0
,
badge
Data
.
length
);
output
.
write
(
documentData
,
0
,
document
Data
.
length
);
writeResultCallback
.
onWriteFinished
(
new
PageRange
[]
{
PageRange
.
ALL_PAGES
});
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -123,7 +123,7 @@ public class PrintingPlugin implements MethodCallHandler {
// Return print information to print framework
PrintDocumentInfo
info
=
new
PrintDocumentInfo
.
Builder
(
"
badge
.pdf"
)
new
PrintDocumentInfo
.
Builder
(
"
document
.pdf"
)
.
setContentType
(
PrintDocumentInfo
.
CONTENT_TYPE_DOCUMENT
)
.
build
();
// Content layout reflow is complete
...
...
@@ -135,7 +135,7 @@ public class PrintingPlugin implements MethodCallHandler {
// noinspection ResultOfMethodCallIgnored
}
};
String
jobName
=
"
Badge
"
;
String
jobName
=
"
Document
"
;
printManager
.
print
(
jobName
,
pda
,
null
);
}
...
...
@@ -143,7 +143,7 @@ public class PrintingPlugin implements MethodCallHandler {
try
{
final
File
externalFilesDirectory
=
activity
.
getExternalFilesDir
(
Environment
.
DIRECTORY_PICTURES
);
File
shareFile
=
File
.
createTempFile
(
"
badge
"
,
".pdf"
,
externalFilesDirectory
);
File
shareFile
=
File
.
createTempFile
(
"
document
"
,
".pdf"
,
externalFilesDirectory
);
FileOutputStream
stream
=
new
FileOutputStream
(
shareFile
);
stream
.
write
(
data
);
...
...
Please
register
or
login
to post a comment