Comments (5)
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.
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.
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.
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)
- Currently failing unit tests in the GitHub Actions pipeline HOT 5
- Can i change the vertical space between lines inside a table? HOT 8
- Creating Links in Table Cells HOT 10
- adding an SVG image displays a black square HOT 6
- Pillow Import Issue when using custom FPDF2 Layer in AWS Lambda HOT 4
- TypeError: FPDF.set_fill_color() takes from 2 to 4 positional arguments but 5 were given HOT 8
- Place image in a background page HOT 8
- Table header override style is not working HOT 4
- SVG inside table cell is stretched forcefully HOT 6
- Leading spaces on new lines ignored in <pre><code> tags HOT 8
- Tables with multiple header rows and merging cells HOT 4
- Test failure in test_share_images_cache on fast computers HOT 1
- Expected behaviour re outer table border with nonzero gutter? HOT 5
- Sections must have a style HOT 2
- Long HTML list entries are not correctly indented HOT 24
- HTML blockquotes are not indented HOT 1
- Combination of set_text_shaping and offset_rendering causing error HOT 5
- `KeyError: '{http://www.w3.org/2000/svg}path'` when using an svg HOT 4
- Error when using multi-page tables in table of contents placeholder HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpdf2.