4 ms·
For a proper page numbering, consistent word wrapping, pixel-perfect font rendering and document outline support.
by magnat 4y ago
For a proper page numbering, consistent word wrapping, pixel-perfect font rendering and document outline support.
- lazyeye 4y agoYou cant do page numbering in html? Seriously? I haven't had an issue with any of these things rendering html to pdf.
- trynewideas 4y agoThe Paged Media spec on counters and counter-resets paints implementations into a corner. They can't both comply with the spec and implement page count resets on page breaks. This has been a known issue with the spec since 2013[1][2] and been a thorn in implementations since.[3] 1: https://www.w3.org/Style/CSS/Tracker/issues/334 https://www.w3.org/Style/CSS/Tracker/issues/334 2: https://github.com/w3c/csswg-drafts/issues/4760 https://github.com/w3c/csswg-drafts/issues/4760 3: https://github.com/Kozea/WeasyPrint/issues/93#issuecomment-465932507 https://github.com/Kozea/WeasyPrint/issues/93#issuecomment-4...
- lazyeye 4y agoHere's some PHP code to handle page numbering (page breaks are no problem at all rendering html to pdf) :- <?php $pagenum = 1; $pagenum++; print("Page: $pagenum"); ?>
- criddell 4y agoI’ve had trouble with html -> pdf when it comes to tables. Most of the packages out there don’t have a way to say “if only the first few rows of the table will render before a page-break, then put the page-break before the table”. Or getting a table to not break at row X when that row has a cell that spans more than one row. Or getting table headings to repeat on the next page when a page-break mid-table is unavoidable. These are all things that good page layout software can deal with easily. HTML to pdf is also pretty slow and unreliable when you want a table of contents or an index with page numbers. On a fast machine, a 200 page PDF can take several minutes to generate. PrinceXML is the only software I’ve tried that does a good job of it. For very simple documents (no CSS, limited Unicode) HTMLDoc is pretty good and very fast.
- lazyeye 4y agoI agree with html you have to manage the pagebreak within the code but honestly its not that complicated to insert a pagebreak based on rowcount.
- deleted 4y ago[deleted]
- paranoidrobot 4y agoRow count is not the only condition for how much can fit on a page. Content matters for row height, as does fonts, styling, etc. Footers, too. The number of footnotes (thus the height of the footer) can depend on the page content, too. Maybe there's an image in there, or some sort of specially styled content that makes the line height larger than normal. You have to be able to render the row to know the final dimensions, to be able to make a call whether it should go on that page or the next. If you don't, then you end up with one page actually rendering over into a second page.