Giter Club home page Giter Club logo

Comments (5)

Lucas-C avatar Lucas-C commented on August 17, 2024

Hi @dmail00

Thank you for reporting this 🙂

.set_section_title_styles() was never planned to be used with .write_html().
HTML headings are supposed to be rendered by fpdf.html.HTML2FPDF, not by fpdf.FPDF.start_section().
For now, I will add code to raise an error if both mechanisms are used (cf. PR #1083).

Why did you wish to use both features at the same time?
Was it that you wanted more control hover HTML headings styling?
If so, some thinking on the subject was started in #1066 (review):

Maybe it would make sense to have a single, shared, configuration entry to be able to set a default style for all HTML elements the same way, including their color?

from fpdf2.

dmail00 avatar dmail00 commented on August 17, 2024

Was it that you wanted more control hover HTML headings styling?

I already have that,

Some of the text I am rendering is known and has headings, whilst other text comes from files on disk which are not know by the code and can include headings.

You current solution is fine, I have hacks for all the issues I have reported.

from fpdf2.

Lucas-C avatar Lucas-C commented on August 17, 2024

You current solution is fine, I have hacks for all the issues I have reported.

Alright.

If you wish to contribute to fpdf2 and share the solutions you found, you are very welcome 🙂

Otherwise, I will close this issue.

from fpdf2.

dmail00 avatar dmail00 commented on August 17, 2024

Well this one seems simple enough.

In write_html cache the section_title_styles and replace with an empty dict, restore the cached vesion on exiting the method.

from fpdf2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.