/*HIDE SECTIONS FOR PRINTING*/
@media print {#tc-page-background {display: none ! important;}}
@media print {.tc-tags-wrapper {display: none ! important;}}
@media print { body.tc-body {background-color: transparent;}
@media print {.tc-image-chevron-up {display: none ! important;}}
@media print {.tc-image-chevron-down {display: none ! important;}}
.sidebar-header, .tc-topbar {
display: none;
}
@media print {
.story-river {
margin: 0;
padding: 0;
}
html body.tc-body .tc-tiddler-frame {
margin: 0;
border-bottom: 1px solid #ccc;
padding: 5px;}
html body.tc-body a.tc-tiddlylink-external:hover {
border: 1px solid <<colour tiddler-border>>;
}
html body.tc-body .tc-tiddler-info {
padding: 14px 42px 14px 42px;
background-color: <<colour tiddler-info-background>>;}
}
}
\whitespace trim<$button tooltip="print tiddler" aria-label="print tiddler" class=<<tv-config-toolbar-class>>><$action-setfield $tiddler="$:/templates/print/tiddler" $field="tiddler-title" $value=<<storyTiddler>>/><$action-sendmessage $message="tm-open-window" $param="$:/templates/print/tiddler"/><$list filter="[<tv-config-toolbar-icons>prefix[yes]]">{{$:/core/images/print-button}}</$list><$list filter="[<tv-config-toolbar-text>prefix[yes]]"><span class="tc-btn-text"><$text text=" "/><$text text="print tiddler"/></span></$list></$button>
\define containerClasses()tc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$\end
\define tiddlerPrintTemplate()
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
<$set name="tv-config-toolbar-icons" value={{$:/config/Toolbar/Icons}}>
<$set name="tv-config-toolbar-text" value={{$:/config/Toolbar/Text}}>
<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}>
<$set name="themeTitle" value={{$:/view}}>
<$set name="currentTiddler" value={{$:/language}}>
<$set name="languageTitle" value={{!!name}}>
<$set name="currentTiddler" value="">
<div class=<<containerClasses>>>
{{$(tiddlerTitle)$}}
</div>
</$set>
</$set>
</$set>
</$set>
</$set>
</$set>
</$set>
</$importvariables>
\end
<$vars tiddlerTitle={{!!tiddler-title}}><<tiddlerPrintTemplate>></$vars>
\define containerClasses()tc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$\end
\define tiddlerPrintTemplate()
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
<$set name="tv-config-toolbar-icons" value={{$:/config/Toolbar/Icons}}>
<$set name="tv-config-toolbar-text" value={{$:/config/Toolbar/Text}}>
<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}>
<$set name="themeTitle" value={{$:/view}}>
<$set name="currentTiddler" value={{$:/language}}>
<$set name="languageTitle" value={{!!name}}>
<$set name="currentTiddler" value="">
<div class=<<containerClasses>>>
<$button class="tc-btn-invisible tc-print-tiddler-print-button" message="tm-print">{{$:/core/images/print-button}}</$button>
{{$(tiddlerTitle)$}}
</div>
</$set>
</$set>
</$set>
</$set>
</$set>
</$set>
</$set>
</$importvariables>
\end
<$vars tiddlerTitle={{!!tiddler-title}}><<tiddlerPrintTemplate>></$vars>
button.tc-print-tiddler-print-button {font-size: 2em;position: fixed;right: 20px;top: 20px;}
@media print {button.tc-print-tiddler-print-button {display: none;}}
Ciao BTC
Great stuff, as usual from you, working to add to basic utility of TW! A few points ... hope they don't come over as negative and might be helpful.
1 - Your solution breaks in v5.1.14 of TiddlyWiki. That is to do with...\whitespace trim... not supported till v5.1.15.
2 - Because the printer dialogue itself is not invoked this won't solve the problem is TiddlyDesktop which currently has neither Ctrl-P, nor Right Click to display menu with a print option. IMO this issue in TD is important to address.
3 - I'm unclear what your solution currently adds over "Open In New Window?"
4 - I think you are hot on this because of previous work you have done related to the timing of appearance of the print dialogue before the Tiddler render is done? :-) In other words, the print could be corrupted/truncated. Right? That led to postponement of getting a Single Tiddler Print option into the basic TW release?
5 - I actually think the Single Tiddler Print thing might better be contextualised as... What a Window of a Single Tiddler is? And what it could contain?i.e. it might be as good, if not better, to have a menu of some sort possible at the top of Single Tiddlers in a Window with a button for Print. (a) It would be more design consistent with current printing of story river & the main TW interface; (b) The timing problem on display of the printer dialogue should go away; (c) Should get round TiddlyDesktop's limitations.
There are other things about Open In New Window that might also be looked at. Like being able to Toggle whether the Title can be displayed etc ...
You get my point? Printing Single Tiddlers could be seen as part of a wider design approach for spawned Window content.
Ciao BTC
Great stuff, as usual from you, working to add to basic utility of TW! A few points ... hope they don't come over as negative and might be helpful.
1 - Your solution breaks in v5.1.14 of TiddlyWiki. That is to do with...\whitespace trim... not supported till v5.1.15.I didn't know that, thanks!
2 - Because the printer dialogue itself is not invoked this won't solve the problem is TiddlyDesktop which currently has neither Ctrl-P, nor Right Click to display menu with a print option. IMO this issue in TD is important to address.
3 - I'm unclear what your solution currently adds over "Open In New Window?"It adds a print button in the top right corner (see my second example) ... about the rest I'm unclear, too
BTC:
BTC: let's play with a mockup:
Added to the toolmap in a new section, Printing, with a little explanation.. https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM
Hello BTC,This is really amazing! Print set of tiddlers in form of a PDF or sent to the physical printer!Thank you!Do you release it as a plugin?What is the pbr on the toolbar? I just print by clicking the printer icon!
BTC
Looking good!
One issue: The "More" (down-arrow) menu won't close once opened (FF & Chrome) for me.
We'll need to dig into the popups-cancelling problem in new tiddly windows
What I'm trying right now is adding sensible features
BTC
@TiddlyTweeter
One issue: The "More" (down-arrow) menu won't close once opened (FF & Chrome) for me.
BTC
Sorry I misunderstood.
Is the issue with the popup's in the child window CSS related?
<br><hr>
Version: <<draftNo>>
Ciao BTC
I was not clear enough. I did not mean a full preview per se. I meant live style changes related to vertical whitespace within it.
It may be that actually the CSS for printing covers inter-included-Tiddler whitespace already on actual print. I need play with that more to be sure.
Ciao BTC
Further to last. A did a bunch of tests and the resultant spacing on actual print is good so my point is actually void.
One thing that I thought was, same as excellent PBR, might be of interest & useful if one could define a fragment of code that could be toggled on or off (i.e. inserted, or not) between Tiddlers (Tiddler specific). I'm thinking of, for example ...
<br><hr>
or maybe wikitext?
Version: <<draftNo>>
BTC: I can only imagine adding the same for all print-tiddlers, not different ones for each one.
BTC: a text field could be added where you can write your separator
BTW, I thought a quite good name for an eventual plugin could be: "Print River"
@BTCI printed some tiddlers. Then I back to select a new set of tiddlers for a new print! When I click the print button in the second time of printing, I see the printriver has kept the list of previous tiddlers in its print queue!How can I flush that queue?
<div style="page-break-after:always"><span style="display:none"> </span></div>
Printing tiddlers?I do not do it very often and prefer print to PDFIn firefox I open the tiddler with the content, including the transclusion of multiple tiddlers if required, if I want title to appear for each tiddler in this print I include them in the tiddler content. Basically I create a Print View Tiddler.I open this print view tiddler in a new window, and print it (hamburger menu on right).
- Of course you may want to change the zoom, shrink to fit,
- Ensure it uses landscape layout
I print to the PDF Printer - Foxit PDF
- I can see a live preview
- This gives me page setup options including
- Margins, headers and footers and more
- Page numbers etc...
- And Printer properties
- Folder/Filename
- Fast webView Format
- Ability to add Document info
The PDF opens in Foxit reader.This is where I tend to stop. In part because the it is easy to return here if I make changes.Keep in mind Foxit Reader allows you to further annotate the PDF file including;
- Arrows/shapes/stamps/highlighter
- Bookmarks
- Notes comments,
Untested lots of features including secure, sign, attachments, adding bookmarks (Saved in PDF)You can export/import comments and highlights so you may be able to apply these again if you regenerate the PDF.There are many export and conversion options under FoxIt reader.RegardsTonyHowever you can open the PDF in Word and do more if you must.
On Thursday, June 7, 2018 at 8:44:00 PM UTC+10, JWHoneycutt wrote:How I print a tiddler:1) Render the tiddler2) Copy / paste it into a word processor3) Fix any formatting that does not come out as expected4) Return to TW5 to get the title (and subtitle)5) Print from word processor6) Any last minute changes from word processor (spelling, PS add-ons, etc) are retyped into TW5I would like to know the process you useI found this in another discussion and created a tiddler with the $:/tags/Stylesheet tag@media print { @page { margin-right: 4.0cm; } }There are scant references to printing - how do you "print to PDF"?As you can see, mine is a very basic question