javascript - Scale element when print web page with IE/Edge -
i customizing styles on web page better printing experience.
i using print media query hide header, footer , nav pane. since size of container may change, trying dynamically scale main container fit paper , keep container's aspect ratio. works in chrome mediaquerylistener (calculate scaling factor based on current container size , paper size, , generate "@media print {.containerclass{transform: scale(0.3)}}". append body). blocked on how in ie (always :-( ).
i looking @ onbeforeprint , onafterprint , thought me. but turned out onafterprint
happened after onbeforeprint
before print dialog, means not technically after print. , when onbeforeprint
gets called, media query hasn't been applied page yet. here problem, scale factor calculation based on paper size , current container size. paper size available when in print mode. seems cannot detect if current page in print mode in ie.
do guys know how achieve in ie/edge?
Comments
Post a Comment