Comments (9)
I was able to figure out what the problem was. I had some parameters defined in the body{} that were causing the problem.
from weasyprint.
I donโt get it. What was the problem? A syntax error that caused the rule to be ignored?
By the way, you might want to use padding-top rather than \a \a \a
in content.
from weasyprint.
Closing as this seems solved. But Iโm still curious as to what was the issue and the solution, if you feel like commenting.
from weasyprint.
Unfortunately, I didn't keep any revision control on the files, so I'm not quite sure what I changed :-( Suffice it to say, that it was my ignorance and not a problem with WeasyPrint.
from weasyprint.
By the way, thanks for the tip about padding-top!
from weasyprint.
For me it didn't work while I had "overflow: auto" on the <body>
element. Removing that made the text box appear.
from weasyprint.
For me it didn't work while I had "overflow: auto" on the element. Removing that made the text box appear.
Great! body { overflow: auto }
breaks the margins for some reason. Minimal case:
<style>
@page { @top-left { content: 'test' } }
body { overflow: auto }
</style>
body
from weasyprint.
This wasn't a bug. This was intentional ๐
WeasyPrint treats all overflow
values but visible
like hidden
.
The spec tells us that
UAs must apply the overflow-* values set on the root element to the viewport.
The viewport in our case is the PageBox (= all pages) and thus the PageBox is clipped, cutting off every single piece of content outside the page box:
Lines 226 to 231 in 27c600f
Obviously, the actual intent of this viewport-overflow is to clip the body, resp. the document content. It should not devour the @page
margin content.
But when we draw the MarginBoxes (being children of the PageBox) after the PageBox has clipped the context to the inner area of the page (rounded_padding_box
)...
from weasyprint.
This wasn't a bug. This was intentional
For sure ๐.
Obviously, the actual intent of this viewport-overflow is to clip the body, resp. the document content. It should not devour the
@page
margin content.
We have other similar workarounds to draw and clip the viewport background. The special cases needed to draw the viewport (and draw the root element a bit differently) are a mess, just like the mess created by the table wrappers. We have to live with that, I thinkโฆ
from weasyprint.
Related Issues (20)
- Weasyprint.exe : Fontconfig error: Cannot load default config file: No such file: (null) HOT 8
- Support of `@media only` HOT 4
- Migrate to resvg? HOT 2
- Support grid-auto-flow: column HOT 4
- Fonts breaking in v62 HOT 8
- Grid support enhancements
- v62 - TypeError: can't multiply sequence by non-int of type 'float' HOT 1
- Create single page pdf for thermal printer HOT 1
- Bold font sometimes work but sometimes doesn't HOT 2
- Grid support with errors (print-css-rocks) HOT 3
- PDF/UA accessibility. Labeled strange.
- TypeError: can only concatenate str (not "float") to str (after update from 61.2 to 62.1) HOT 5
- Tailwind color codes are incompatible HOT 2
- Issue when trying to write a pdf with the openssl_md5 function in your library HOT 1
- Failure when building wheel for 62.1 from pypi HOT 5
- Add support for ol start attribute HOT 2
- Weasyprint (62.1) broken on macOS using Python 3.12.3 from python.org HOT 3
- python api: set created date HOT 3
- Support overflow-x/y HOT 1
- display flex is breaking UI HOT 1
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 weasyprint.