I got a custom CSS from this forum (sorry, now I cannot find it anymore), did tiny modifications in body section (mostly adjust font and alignment), and it can be seen very well in RSS:
Printing with Default.css is done right. Added to this, my customized CSS, when dark mode, shows text in black and background in black. However, Default.css shows right inverted colors.
My question is: where is located default.css to pick it, modify and put modified version in custom CSS folder? I looked inside DT3 bundle but didn’t found it.
You could use a media query in your CSS and then define styles that are used in print only.
PDFs are by default paginated, and since you print to sheets of paper… But you could use CSS attributes in your stylesheet to set conditions for the page breaks.
In any case, layout in PDF has to obey more restrictions than on screen. E.g. you can not simply widen your sheet of paper as you can a browser window. So no fluid layout on paper, or at least only very limited.
According to MDN, overflow-block is hardly supported and paged is not listed there as a keyword. So you might want to try without this. Also the “orphans: 3;” doesn’t make much sense here, I think. orphans gives the minimum number of lines at the bottom of a page. img and svg do not have lines, I think. And I’m not sure how that works with table either. But I may be wrong here, of course.
It might be helpful to know more about the structure of the original document. Could you provide a link? I wasn’t able to find anything by googl’ing for the top line.
It is a variation of the original DT Default.css. I’m attaching my last version, updated with other variations got from StackOverflow (sorry, I’m not an HTML/CSS guy).rfog_default.css.zip (1.6 KB)
I just saw the original URL after I posted (I didn’t mean the CSS but the RSS ;-).
If I clip this link as Markdown to DT, it seems to print ok. I.e. there are no page breaks in the middle of the images. Would that be an option for you?
On the other side, the CSS you linked to (rfog_default) contains the line
* {display: inline}
in the @media printsection. This looks weird to me, since it would treat all elements like lines of text. Even images, tables etc. that are usually considered blocks.
I use a little bit more complex scenario. I use combination of DEVONsave (from MacStories) + HTML to PDF from DEVONsave posted here, get a HTML file that is converted into PDF. That works fine without line breaks and only some reasonable image cuts if the image is too big to fit in a page.
However, I would like to print to pdf from DT itself directly from DT RSS…
Now you have me utterly confused. The code you mentioned above is not in the CSS you linked to. Neither is the one you just posted. What is the current version that you use?
Ha, ha. I’m trying a lot of combinations. None work. The one I posted last was my last test. The CSS file is the same, the one I’ve attached, and I change the “@media print {}”, test it and search for a new variation.
Your variation does nothing with the images: they are cutted in middle of page break.
This should set the background to all elements to a light grey and the font to one with serifs (like Times). If nothing changes than this (part of the) style sheet is apparently ignored.
Seems it is ignored, as nothing is changing… And the CSS file is being used because if I change alignment (for example) in normal css section, both printing and showing the feed changes accordingly after change (and going back and forth from other css to my css).