-
Notifications
You must be signed in to change notification settings - Fork 542
Paging support in PDF added #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added support for position: fixed in pdf
|
NICE! |
|
@ArthurHub could you publish nuget package update with this fix :) ? |
|
I'm looking to get this functionality as well, so it'd be much appreciated if the nuget package were to be updated. |
|
page-break-inside: avoid doesn't include e.g. I would be grateful for fix |
|
I downloaded the demo code, which includes all the changes described here, however the resulting PDFs do not break as the description states. I used the "Breaking pages 1" and "Breaking Pages 2" sample code. I would be EXTREMELY excited if this code did work as described and illustrated above, it is exactly what I'm looking for. Until then I am trying all kinds of styles/methods. I even downloaded all the code and built it myself without nuget with the same results. |
|
@amreimer yes I've also been unable to get it to work - even when downloading and building the code myself. I'd be happy to look into fixing this myself, but because I can't get the feature to work at all it's kind of hard to know where to begin! For the time being, to prevent words getting cut in half across pages I've had to wrap each paragraph in a table with If anyone could provide steps to get this feature working, or even ideas on where I should start bug hunting, please let me know. |
|
@HumanRob @amreimer Hey! I have recently decided to join this project and started looking into the page-breaking code in specific (I have my own self interests in making it work haha). That being said, I think the words will break a page correctly if the immediate parent element has that attribute on it and if the parent element is smaller than the size of the page. Should work Will fail Unfortunately I am a bit busy the next few weeks, but when I am free I will do my best to implement some generic page breaking that works with nested elements. Also if you only really care about making sure words are not split in half you can change the following code: CssRect.cs ln307 From: To: If I am correct (I may be wrong, I have only started to get into this code) this change will make sure that no words will ever be split on a page break. |
|
@PawelMaj I believe you actually mean: CssLayoutEngine.cs ln307 |
|
It is on CssLayoutEngine.cs ln307 |
|
I was having the issue of pages being split right through the text and adding this bit of css seems to have fixed the problem |
|
@gyfke |
|
@gyfke @grandpaSam - I'm having exactly the same issue, whereby on the first page, the margins are in relation to the fixed content (i.e. the header and footer). On the subsequent pages the margins are in relation to the page itself, therefore my subsequent pages have overlapping objects. p.s. I am using this in combination with the paging tables. |
|
@ArthurHub is this available in current 1.5.0.6? |
|
I noticed that the example program has the same header margin problem as in the i described in my previous comment. |
|
Is there any chance this changes with Great work with this package anyway 👍 |
|
I experience the same issue as RylaiSlyfe. |
|
I have the temporary solution of wrapping my text in tables. Not ideal to be honest.... |
|
Woow, works for me. This in the work project. Thanks |
|
@ksingamreddy did you find out how to get rid of this edges? |
|
@dlaczny we replaced HTML tables with divs to get rid of the edges. |
How did you manage to position your divs? I cant get absolute positioning, floats, flex or grids working in the renderer. |





content: url()
Added support for images in css content property so you can reuse embedded images
Example:
... <img class="logo"> ...Paging in PDF
Implemented css property page-break-inside. It supports two values: auto (default) and avoid
The same is for th, p, span and I guess for any text in any other tags (though I’ve checked only aforementioned)
If row is bigger than page then it doesn’t make sense to transfer it and the value of page-break-inside will be ignored.
Known cosmetic issues:
And all the text will be transferred to the next one
Headers and footers
Added support for position: fixed, elements with fixed position are rendered on every page and can be used as headers/footers/watermarks.
It ignores page margins, so if you need to place 50px-height header and footer on the page with 20px margins you need to set top/bottom margins to 70px to leave proper margins for the main content. Example: