Rotate a PDF object using javascript

I have a pdf embedded inside html.

<object id="img" height="540" width="100%" type='application/pdf' data="http://file.pdf" /> 

I need to rotate it using javascript (or jquery) something like $("img").rotate(90);

How can i do this?

0
source share
2 answers

to try

 $("#img").css({'transform':'rotate(90deg)', '-o-transform': 'rotate(90deg)', '-ms-transform': 'rotate(90deg)', '-webkit-transform': 'rotate(90deg)' }); 
+1
source

You can use the css transform property http://www.w3schools.com/css/css3_2dtransforms.asp

 #img { -o-transform: rotate(90deg); -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); } 
+1
source

Source: https://habr.com/ru/post/1014192/


All Articles