Create PDF Book from Collection of Tiddlers

Tiddlywiki does not itself have a tool to simply create booklet or pdf book from tiddlers collection! PrintRiver is a plugin from @BurningTreeC can be considered as useful one in this regard but it does not have what I mean here!

I am looking for a tool to be able

  1. Select some tiddlers (e.g. through filter)
  2. Able to add header footer page
  3. Create the booklet or pdf book on click
  4. Download the pdf

I appreciate to let me know if there is any tools around or any project considered this.

6 Likes

Yes, I need this too!

@Mohammad I think the simplest solutions are still going to involve opening the content in a new window with a custom stylesheet and using the browser print to PDF feature.

Where there is scope to make things easier is to have a tool to select the tiddlers, add the header and footer etc, view all of it in the right order, etc… all of which can be done via wikitext.

This will need to be in place even if we use a JavaScript library to actually create the PDF instead of using the browser print feature.

1 Like

Hi Saq,

Thank you for info.

I support your idea to adopt and use a JS library for this purpose as there are a lot of efforts out there trying to make industry standard PDF from html files.

But as you said we need to send tiddlers to print window and this will need some effort on TW side!
This can be a plugin to do the job and also interact with JS library!

You know PDFs are quite common in many environment including academic!

1 Like

That’s right. But may universities have very special requirements about how the documents have to be formatted. These requirements may vary from institute to institute. …

Yes @pmario , the requirement are different! I just mean PDFs (ebook, thesis, reports,… etc) are very common and used on daily basis!

We can think here to generate PDF books like Wikipedia ones and of course a good plugin will allow user to customize the output!

Later one can use a template here and produce his/her PDF of choice!

Glad to see this gap has been pointed out. This deserves further exploration with working code. I think something that allows flexible formatting of the PDF document output would be more desirable.

This isn’t a direct answer per-se, but I will say it’s similar need to what’s provided by RMarkdown. R is a statistical programming language I use for my work, and they have a markdown language and plugins that go from a few things (R / Python / SQL etc.) through R Markdown and to many things (HTML pages, PDF, Word, Beamer, HTML5 Slides, Books, Dashboards, Articles, Websites etc…)

While it’s pretty far off wikitext, given that it’s open-source, if somebody were to spend effort on this, they might want to leverage what’s been built there as well.

image

There is also a related project (bookdown) that goes all the way to full books, and I’ve learned R through textbooks that were created this way - common in data science

https://rmarkdown.rstudio.com

1 Like

Wonder how Pandoc and RStudio’s tool compare. I would think we’d definitely want someone else to do the PDFing, so we would have to get our tiddlers into a format (markdown, HTML, ?) they could ingest.

I have come late here, but I already produce PDF documents from tiddlywiki. Just build a tiddler that displays the content you want in your pdf, bring in content from as many tiddlers you want.

Now Open in new window and Print (Use shortcuts if necessary) and select a PDF printer.

It is easy to insert page breaks in the output (invisible to interactive user) which throws page breaks when needed.

To me the effort should be put into predictive page breaks and tools to support page layout in tiddlywiki. Remember also generating html output and saving to files is trivial in tiddlywiki and is often a valid import source to many other document apps.

1 Like

As a community we should add Pandoc a converter to/from tiddlywiki markdown.

1 Like

@TW_Tones I wonder if this would be useful to some people, maybe coupled with some templates. A lot of my wikis’ HTML comes through macros, though, so if I wanted to generate PDF reports or something, I’d have to start at the HTML stage you were discussing in your previous post.

I think I’ve surpassed my current expertise on this topic and would have to do some reading to have any good opinions!

Best,
Chris

Here is a little more on this subject

If you install the plugin “internals”, the preview on tiddlers includes a HTML view. This can be copied and pasted elsewhere. As long as it renders on the screen it is presented in HTML, however with a little trickery it can be exported, or printed. Jeremy pointed out if you save some output such as a tiddler as static html and rename it to docx and open it with Microsoft Word you have converted it.

This approach using any appropriate word processor could be used for what we may call “print preparation” ie all the content is collected and presented in tiddlywiki, then you use a word possessor for final print and pdf preparation using auto and manual page breaks, headers footers and page numbers etc…

  • With the above workflow refined many will be happy and need no more, they can control and organise there information in tiddlywiki and use a for purpose tool to make use of its sophisticated print preparation and output.
  • However we can progressively move more of these print preparation methods into tiddlywiki, with each new feature there will be a subset of documents that do not need the additional print preparation.
  • I have already used html tables to page break with column headings/footers repeated as needed and can print these directly to PDF/printer.

I’ve never seen a HTML-based solution for PDF that didn’t mess up somewhere. There are extensions that can convert your page to PDF, but they usually get the formatting wrong. Printing to PDF almost always cuts across lines and images.

What I do is copy the rendered text into libreoffice or word. These products have decades of experience with formatting text. Then export to PDF, which is better than printing because you’re more likely to get exactly what you see. The whole process is very fast, at least if I’m using an existing document as a starting point.

1 Like

Somewhere on GG I posted a LUA filter for conversion to markdown (I think). Making an actual converter is difficult, but making a conversion filter is pretty straight forward, though it’s written in LUA which isn’t even the base language of Pandoc.

Hi Mark,
How do you copy the rendered text, specially when the text is created from many tiddlers and produces long page?

Typora

@Jason_Cunliffe please explain in your reply/post why you share a link when you do. The community should be rightly suspect if someone is posting links without explanation. They could be phishing. The Last person that did a lot of this, was eventually banned, their behaviour became quite suspect.

All you need to do is explain why you thing a link is relevant to the topic and why someone may want to look at it.