David PHAM-VAN

Change temporary file name

@@ -82,7 +82,7 @@ public class PrintingPlugin implements MethodCallHandler { @@ -82,7 +82,7 @@ public class PrintingPlugin implements MethodCallHandler {
82 } 82 }
83 } 83 }
84 84
85 - private void printPdf(final byte[] badgeData) { 85 + private void printPdf(final byte[] documentData) {
86 PrintDocumentAdapter pda = new PrintDocumentAdapter() { 86 PrintDocumentAdapter pda = new PrintDocumentAdapter() {
87 PrintedPdfDocument mPdfDocument; 87 PrintedPdfDocument mPdfDocument;
88 88
@@ -93,7 +93,7 @@ public class PrintingPlugin implements MethodCallHandler { @@ -93,7 +93,7 @@ public class PrintingPlugin implements MethodCallHandler {
93 OutputStream output = null; 93 OutputStream output = null;
94 try { 94 try {
95 output = new FileOutputStream(parcelFileDescriptor.getFileDescriptor()); 95 output = new FileOutputStream(parcelFileDescriptor.getFileDescriptor());
96 - output.write(badgeData, 0, badgeData.length); 96 + output.write(documentData, 0, documentData.length);
97 writeResultCallback.onWriteFinished(new PageRange[] {PageRange.ALL_PAGES}); 97 writeResultCallback.onWriteFinished(new PageRange[] {PageRange.ALL_PAGES});
98 } catch (IOException e) { 98 } catch (IOException e) {
99 e.printStackTrace(); 99 e.printStackTrace();
@@ -123,7 +123,7 @@ public class PrintingPlugin implements MethodCallHandler { @@ -123,7 +123,7 @@ public class PrintingPlugin implements MethodCallHandler {
123 123
124 // Return print information to print framework 124 // Return print information to print framework
125 PrintDocumentInfo info = 125 PrintDocumentInfo info =
126 - new PrintDocumentInfo.Builder("badge.pdf") 126 + new PrintDocumentInfo.Builder("document.pdf")
127 .setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT) 127 .setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT)
128 .build(); 128 .build();
129 // Content layout reflow is complete 129 // Content layout reflow is complete
@@ -135,7 +135,7 @@ public class PrintingPlugin implements MethodCallHandler { @@ -135,7 +135,7 @@ public class PrintingPlugin implements MethodCallHandler {
135 // noinspection ResultOfMethodCallIgnored 135 // noinspection ResultOfMethodCallIgnored
136 } 136 }
137 }; 137 };
138 - String jobName = "Badge"; 138 + String jobName = "Document";
139 printManager.print(jobName, pda, null); 139 printManager.print(jobName, pda, null);
140 } 140 }
141 141
@@ -143,7 +143,7 @@ public class PrintingPlugin implements MethodCallHandler { @@ -143,7 +143,7 @@ public class PrintingPlugin implements MethodCallHandler {
143 try { 143 try {
144 final File externalFilesDirectory = 144 final File externalFilesDirectory =
145 activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES); 145 activity.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
146 - File shareFile = File.createTempFile("badge", ".pdf", externalFilesDirectory); 146 + File shareFile = File.createTempFile("document", ".pdf", externalFilesDirectory);
147 147
148 FileOutputStream stream = new FileOutputStream(shareFile); 148 FileOutputStream stream = new FileOutputStream(shareFile);
149 stream.write(data); 149 stream.write(data);