Przeglądaj źródła

Merge branch 'fix_pdf_print_format'

liweihao 6 lat temu
rodzic
commit
57f71248e4

+ 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;