Browse Source

Merge branch 'fix_pdf_print_format'

liweihao 6 years ago
parent
commit
57f71248e4
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/java/com/bomostory/sceneeditmodule/PrintTools.java

+ 5 - 1
src/main/java/com/bomostory/sceneeditmodule/PrintTools.java

@@ -69,8 +69,12 @@ public class PrintTools {
         // Start a print job, passing in a PrintDocumentAdapter implementation
         // to handle the generation of a print document
         try {
+            PrintAttributes.Builder builder = new PrintAttributes.Builder();
+            PrintAttributes.MediaSize mediaSize = PrintAttributes.MediaSize.ISO_A3;
+            builder.setMediaSize(mediaSize.asLandscape());
+
             android.print.PrintJob job = printManager.print(jobName, new MyPrintDocumentAdapter(context),
-                    new PrintAttributes.Builder().build());
+                    builder.build());
             if (job == null) {
                 Toast.makeText(context, "print failed!", Toast.LENGTH_SHORT).show();
                 return;