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

Ordered list style? #59

Closed adaptifyDesigns closed 7 years ago

adaptifyDesigns commented 7 years ago

By default, ordered lists seem to be styled like unordered lists (with bullets, instead of numbers).

BUT, the scraped html (printed in the console) looks like this:

<ol style="height: 91px; list-style-type: decimal; margin-top: 12px; margin-bottom: 12px; padding-left: 40px; width: 680.375px;">
    <li style="display: list-item; height: 15px; margin-top: 0px; margin-bottom: 4px; padding-left: 0px;">This</li>
</ol>

As you can see, the list-style-type property is correctly applied to the <ol> element. So I'm wondering why the list is formatted like an <ul> in the resulting pdf.

Any ideas?

kbrown01 commented 7 years ago

Seems like an issue I tried to work at long ago. I see that I left a note on this page:

http://www.cloudformatter.com/CSS2Pdf.Demos.Lists

And the formatting in that page does not work either for the numbered lists.

The issue is somewhere in the XSL that is converting the submitted scraped HTML (cleaned to XML).

That XSL is here: http://xep.cloudformatter.com/doc/XSL/xeponline-fo-translate-2.xsl

As defined by this: xsl_stylesheet_declaration: '<?xml-stylesheet type="text/xsl" href="http://xep.cloudformatter.com/doc/XSL/xeponline-fo-translate-2.xsl"?>',

Give me a little time to investigate where the bug in the XSL is.

Kevin Brown

From: adaptifyDesigns [mailto:notifications@github.com] Sent: Friday, February 24, 2017 11:24 PM To: Xportability/css-to-pdf css-to-pdf@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Xportability/css-to-pdf] Ordered list style? (#59)

By default, ordered lists seem to be styled like unordered lists (with bullets, instead of numbers).

BUT, the scraped html (printed in the console) looks like this:

  1. This

As you can see, the list-style-type property is correctly applied to the

element. So I'm wondering why the list is formatted like an

in the resulting pdf.

Any ideas?

— 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/59 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAsJowAakNcygMizI7pEskUju7bueungks5rf9cWgaJpZM4ML74x . https://github.com/notifications/beacon/AAsJo8eAS0hd2Fj_bBdrsOEMhjWFmFOEks5rf9cWgaJpZM4ML74x.gif

kbrown01 commented 7 years ago

Fixed. Bug in the XSL. Tested at http://www.cloudformatter.com/CSS2Pdf.Demos.Lists and works as shown in the page.

adaptifyDesigns commented 7 years ago

Thanks!