Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
207 stars 77 forks source link

Failed to execute 'getComputedStyle' on 'Window' #69

Open luizabentivoglio opened 7 years ago

luizabentivoglio commented 7 years ago

I have this error:

pen.js:270 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. at Object.getRealStyle (pen.js:270) at Object.copyComputedStyle (pen.js:280) at Object.flattenStyle (pen.js:134) at String. (pen.js:761) at Function.each (jquery.min.js:2) at n.fn.init.each (jquery.min.js:2) at Object.__format (pen.js:748) at Object.Format (pen.js:855) at HTMLButtonElement.onclick (index.html:320)

this is my pen https://codepen.io/anon/pen/GvZjrz

I don't understand because offline everything is working but when i try on my server i have this error...

kbrown01 commented 7 years ago

I see two issues.

1) You should not use the body tag, please insert a div and use that div. Just put that div inside body.

2) Because you are using Codepen, which is https you will need to use https URLs in the Javascript.

I updated these are it formats.

https://codepen.io/anon/pen/mMPwew

Kevin Brown

From: Luiza.Bentivoglio [mailto:notifications@github.com] Sent: Monday, July 31, 2017 8:02 AM To: Xportability/css-to-pdf css-to-pdf@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Xportability/css-to-pdf] Failed to execute 'getComputedStyle' on 'Window' (#69)

I have this error:

pen.js:270 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. at Object.getRealStyle (pen.js:270) at Object.copyComputedStyle (pen.js:280) at Object.flattenStyle (pen.js:134) at String. (pen.js:761) at Function.each (jquery.min.js:2) at n.fn.init.each (jquery.min.js:2) at Object.__format (pen.js:748) at Object.Format (pen.js:855) at HTMLButtonElement.onclick (index.html:320)

this is my pen https://codepen.io/anon/pen/GvZjrz

I don't understand because offline everything is working but when i try on my server i have this error...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Xportability/css-to-pdf/issues/69 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAsJo8Iyv_9YoZdCyIAJ-jKzadgGuP6pks5sTexugaJpZM4Oog-y . https://github.com/notifications/beacon/AAsJoxukswAe1uYV9llo3o8Sejoq7lveks5sTexugaJpZM4Oog-y.gif

luizabentivoglio commented 7 years ago

Thank you so much Kevin!!!!!!!! :D

luizabentivoglio commented 7 years ago

Kevin, how i can fix float-left/float-right instructions for Internet Explorer? i have to use position absolute or something else? Thank you