gpt4 book ai didi

android - 如何更改android默认打印对话框的纸张大小?

转载 作者:行者123 更新时间:2023-11-29 14:37:20 26 4
gpt4 key购买 nike

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

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

最佳答案

After searching lot i got the answer , you have to change the PrinterAttributes Refer this link

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());

That's it.

关于android - 如何更改android默认打印对话框的纸张大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29070743/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com