如何更改android默认打印对话框的纸张大小? [英] how to change android default printing dialog paper size?

查看:459
本文介绍了如何更改android默认打印对话框的纸张大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用默认的android打印机,我已经遵循了链接打印Web视图.

I am using default android printer in my application i have followed this link to print the web view.

它可以打印了,但是我的问题是,当打印对话框打开时,默认页面大小是A4,可以将纸张大小默认更改为A5吗?我在Google尝试过,但找不到答案,有人可以帮助我

it gets printing but my problem is when the print dialog opens the default page size is A4 , it is possible to change the paper size to A5 as default?? i tried in google but i can't find the answer, can anyone help me

推荐答案

搜索了很多我得到的答案之后,您必须更改PrinterAttributes.请参考我的android代码更改是

And i android code change is

 PrintAttributes.Builder builder = new PrintAttributes.Builder();
 builder.setMediaSize( PrintAttributes.MediaSize.ISO_A5);
 PrintJob printJob = printManager.print(jobName, printAdapter, builder.build());

就是这样.

这篇关于如何更改android默认打印对话框的纸张大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆