Native js printing, how to customize the page size with js, ask for advice, thank you very much! (native js print customization problem)

the existing functions such as printing and automatic paging have been implemented with native js, but the paper size cannot be customized. I do not want to set the paper size on the preview page manually, and the given paper size does not meet the business requirements

.
Apr.05,2021

not everything can / should be controlled by code. Printing function does not belong to js , but belongs to WEB API , so there is no such function in WEB API .
personally, I think you are just providing services, and you should not choose whether it is color typing / black and white or A4/A5 . You don't even know whether the user's printer supports or what habits the user has, whether he is nearsighted or presbyopia. If you need that dimension style, you can configure your own default style.

Menu