Question about: Printing in Tiddlywiki

471 views
Skip to first unread message

Mohammad

unread,
Oct 28, 2019, 9:39:38 AM10/28/19
to tiddl...@googlegroups.com
While TW encourages to do not print and remain green and EnviroFriend (don't waste papers!!)
But there are situations where you have to print or create a single PDF from a tiddler or a river of tiddlers!
It seems TW is not very user friendly in such a case!

Question:
 I have created a tiddler using a custom class (say notebook) and when I want to print, in the preview I see different margins, padding not easy to modify or difficult
for TW user to write or modify a CSS.

For example see the below tiddler


I had to write a stylesheet for printing as below

I would like to have your advise if my CSS is correct or there is something easier to control printing!


Footnote:
I have created a tiddlyspot page as a playground for printing in TW. So the whole story ca be fond at


References

Mohammad 28th October 2019 at 5:08pm

Plugins

Printriver
http://printriver.tiddlyspot.com/

Discussion

View and Print tiddlers with page handling - help requested
https://groups.google.com/d/msg/tiddlywiki/SthCKBaE0c0/tr7PrKjXDwAJ
Basic question - how do you print a tiddler?
https://groups.google.com/d/msg/tiddlywiki/SYGksSEeNTA/-75B6u1EAwAJ


Mohammad

Mohammad

unread,
Oct 28, 2019, 11:03:59 AM10/28/19
to tiddl...@googlegroups.com
Also worth to note the proposal by BTC for have a print river in the core!


And this by BTC


--Mohammad

Sycom

unread,
Oct 28, 2019, 5:36:43 PM10/28/19
to TiddlyWiki
Hello Mohammad,

As far as I know much of the problems with printing are browser's problems, far more than tw's. A lot of prints rules are not implemented nor consistent.

I struggled with this for a professional project. It's only a demonstrator and will not go further. And maybe it will not help at all. But you may find hints (or not ;-) within stylesheet.

* https://know-rmandie.frama.io/TiddlyPAC/tiddlyPAC-Normandie.html for "print" testing (in a PDF of course it's about 50 pages long ;-)
* https://framagit.org/know-rmandie/TiddlyPAC for the code

Cheers

Sylvain
@sycom

TonyM

unread,
Oct 28, 2019, 7:19:48 PM10/28/19
to TiddlyWiki
Mohammad,

I recently developed a solution for a client. I will look at your links soon.

I avoided the complexity of dealing with printing from the tiddlywiki page and printing the story. Instead I did what I could to make the contents of a single tiddler wysiwyg what you see is what you get (except pagebreaks), you could read the tiddlywiki.com reference to substories if you did want to print a story.

One you have a single tiddler displaying what you want use open in new window and trigger the print from there. This removed the complexity of the full page from the print process.

I have seen some cases where the new window looses some css and you may need import variables or transclude css into your print tiddler so its available in the new window (as a last resort).

I will post more tips from my desktop.

Tony

TonyM

unread,
Oct 28, 2019, 7:35:09 PM10/28/19
to TiddlyWiki
Mohammad more...

If your print tiddler consists only of a table, you can use online documented methods to repeat headings and throw page breaks using <thead><tfoot><tbody> tags (in that order). 

CSS in a @media print is only applied at print time, see below for one I created as a start.

If you are printing more than a single tables you will need to include page headers and footers, if you use both it does get a little more complex.

With both page headers and a table the trick is to define css to create headers and footers with fixed positions (and height) but use this same height in an invisible table row in the header and footer of the table so it does not overwrite the page header and footer.

@page {
   margin: 1cm; 
}

@media print {
  header {
    position: fixed;
    top: 0;
    width: 100%;
  }
  footer {
    position: fixed;
    bottom: 0;
    text-align: centre;
    width: 100%;
  }
  tfoot {
    page-break-after: always;
  }
  thead {
    display: table-header-group;
  }
  tbody {
    page-break-inside: avoid;
  }
  tr, td {
    page-break-inside: avoid;
  }
  /* Spaces added as rows in tables to stop overlap of page header and footer, hidden on screen */
.header-space {
   height: 110px;
   border-style: none;
   border: none;
   width: 100%;
   }
.footer-space {
   height: 80px;
   border-style: none;
   border: none;
   width: 100%;
  }
}
/*
@media screen {
.header-space {
   display: hidden;
   }
.footer-space {
   display: hidden;
  }
}
*/

I will watch this thread if you need additional help.

Regards
Tony

TonyM

unread,
Oct 28, 2019, 7:38:15 PM10/28/19
to TiddlyWiki
An example of the header space  in a table, as defined in above css;

<thead>
<tr class="header-space">
 
<td colspan="5" style="border: none; background-color: white;">&nbsp;</td>
</tr>
<tr style="border: none;">
<td style="width: 10%; border: none; background-color: white;"></td>
<td colspan="3" style="width: 80%; font-size: 150%; border: none; background-color: white;">''{{!!list-header}}''</td>
<td style="width: 10%; border: none; background-color: white;"></td>
</tr>

Tony

Mohammad

unread,
Oct 29, 2019, 1:54:13 AM10/29/19
to TiddlyWiki
Hi Sylvain,
 Many thanks for sharing your wiki and css stuff. I see nice preview and I like the css.
I add link and description in http://tw5-print.tiddlyspot.com/ for future references.

I can use part of css.

Cheers
Mohammad

Mohammad

unread,
Oct 29, 2019, 2:09:50 AM10/29/19
to TiddlyWiki
Hello Tony!
 Many thanks for sharing your solution. Yes, that is true.
I think TW deserve to have a print preview page and lets adjust margins, show/hide elements, choose paper and like that.
The solution started by BTC is great but it needs to be completed and also include support for tables, ... you mentioned here.

I have added your points and css to http://tw5-print.tiddlyspot.com/  for future reference.
I also welcome if you have any further comment on http://tw5-print.tiddlyspot.com/

--Mohammad

Mohammad

unread,
Oct 29, 2019, 2:29:39 AM10/29/19
to TiddlyWiki
Sylvain,
 Is this the css you used?
$:/pac/styles.css

--Mohammad

On Tuesday, October 29, 2019 at 1:06:43 AM UTC+3:30, Sycom wrote:

Mohammad

unread,
Oct 29, 2019, 2:30:03 AM10/29/19
to TiddlyWiki
More stuff on the net for printing tiddlers: http://tw5-print.tiddlyspot.com/

Print Stylesheets

Mohammad 29th October 2019 at 9:54am

These are some great references for printing web page using print stylesheets

A Guide To The State Of Print Stylesheets In 2018 (***)
https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/
How To Set Up A Print Style Sheet (a little old **)
https://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/

Sylvain Comte

unread,
Oct 29, 2019, 4:26:59 AM10/29/19
to tiddl...@googlegroups.com
Hello Mohammad,

Glad you like it and find it useful. I did this some times ago now, so I can't be 100% sure, but I think all adaptations are in this CSS.

Cheers,



--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/EHmnIW13uoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/28ce70e0-3b8f-4e7f-a5d3-8670ff61d6bf%40googlegroups.com.

Mohammad

unread,
Oct 29, 2019, 4:38:42 AM10/29/19
to TiddlyWiki
Thanks Sylvain!


On Tuesday, October 29, 2019 at 11:56:59 AM UTC+3:30, Sycom wrote:
Hello Mohammad,

Glad you like it and find it useful. I did this some times ago now, so I can't be 100% sure, but I think all adaptations are in this CSS.

Cheers,


On Tue, Oct 29, 2019 at 7:29 AM Mohammad <mohamma...@gmail.com> wrote:
Sylvain,
 Is this the css you used?
$:/pac/styles.css

--Mohammad

On Tuesday, October 29, 2019 at 1:06:43 AM UTC+3:30, Sycom wrote:
Hello Mohammad,

As far as I know much of the problems with printing are browser's problems, far more than tw's. A lot of prints rules are not implemented nor consistent.

I struggled with this for a professional project. It's only a demonstrator and will not go further. And maybe it will not help at all. But you may find hints (or not ;-) within stylesheet.

* https://know-rmandie.frama.io/TiddlyPAC/tiddlyPAC-Normandie.html for "print" testing (in a PDF of course it's about 50 pages long ;-)
* https://framagit.org/know-rmandie/TiddlyPAC for the code

Cheers

Sylvain
@sycom

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/EHmnIW13uoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

Mohammad

unread,
Mar 16, 2020, 2:53:40 AM3/16/20
to TiddlyWiki
Reminder:

 PrintRiver plugin is a great plugin lets produce customized PDFs, hard copies, and even other final formats.
 BTC proposed to add this to core, if not I propose to publish it as an official plugin and to do this I needs some more polishing!

This is to remind BTC and Jeremy and also everybody in favor of this to support the idea here or at GitHuB: https://github.com/Jermolene/TiddlyWiki5/issues/4352

--Mohammad



On Monday, October 28, 2019 at 5:09:38 PM UTC+3:30, Mohammad wrote:

TiddlyTweeter

unread,
Mar 16, 2020, 7:44:20 AM3/16/20
to TiddlyWiki
I agree.

Of proposed enhancements over time this is one of the nicest. It extends TW function in a way relevant to much common use. High relevance!

Best wishes
TT

AlexHough

unread,
Mar 16, 2020, 9:02:20 AM3/16/20
to TiddlyWiki
and in light of the new developments in publishing and annotation ... it feel like we are nearly there, at the place where TW is all we need


Alex

TiddlyTweeter

unread,
Mar 16, 2020, 10:50:00 AM3/16/20
to TiddlyWiki
Alex, a Github upvote could help move it on ... 

Alex Hough

unread,
Mar 16, 2020, 1:22:20 PM3/16/20
to TiddlyWiki
Done! (I think!)
I've clicked in a thumbs up


Alex

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/59024c12-aa72-4197-8438-036a1aa58a09%40googlegroups.com.

TonyM

unread,
Mar 16, 2020, 5:28:57 PM3/16/20
to TiddlyWiki
Mohammad,

I expect you know but tables built using thead, tfoot and tbody (in that order) can paginate tables when printing. Being able to set a height and activate scrolling would be helpful. Once combined with page headers and footers it can get complex but it is possible. In time I will present some solutions (IF you don't beat me to it).

Regards
Tony

Mohammad

unread,
Mar 17, 2020, 1:06:39 AM3/17/20
to TiddlyWiki
Thanks Tony!
 The purpose was to remind BTC and Jeremy to upgrade the print feature and perhaps publish a polished PrintRiver from BTC as official plugin.
--Mohammad

Petruschka

unread,
May 2, 2020, 4:51:08 PM5/2/20
to TiddlyWiki
Hello Mohammad,
I tested your PrintRiver plugin but it seems it failed to work. Any news regarding it?


Mohammad

unread,
May 3, 2020, 12:35:39 AM5/3/20
to TiddlyWiki
Petruschka,
 The PrintRiver plugin was created and maintained by BurningTreeC!
 I hope he see the post!

--Mohammad

Petruschka

unread,
May 3, 2020, 11:03:52 AM5/3/20
to tiddl...@googlegroups.com
Apologies Mohammad!

@BurningTreeC Maybe you could take a look at it?
Reply all
Reply to author
Forward
0 new messages