Embedding PDF : missing application/pdf content type

Hello,

TiddlyWiki web site provides an help topic (1) to embed pdf inside a tiddler using a _canonical_uri field and setting the type field to application/pdf. This type is also mentioned in the ContentType documentation (2).

However, when editing a tiddler this application/pdf is not present in the dropdown list.

How can this application/pdf type be added?

Maybe this could be also updated in the next TiddlyWiki version?
(In that case icons and csv are also mentioned in the documentation but are not present in the dropdown - adding webp images could also be useful)

References

  1. https://tiddlywiki.com/#How%20to%20embed%20PDF%20and%20other%20documents
  2. https://tiddlywiki.com/#ContentType

First, please note that it is not necessary to have a specific content type listed in the droplist in order to use it.
You can always enter the content type manually; i.e., just type in “application/pdf”, “text/csv”, “image/icon”, or “video/webm”.

Nonetheless, if you want to add a MIME type to the droplist:

  • Create a tiddler whose title begins with $:/language/Docs/Types/ followed by the desired MIME type (e.g., $:/language/Docs/Types/application/pdf)
  • add field name containing the MIME type (e.g., “application/pdf”)
  • add field description containing a description (e.g., “PDF document”)
  • add field group containing a group name (e.g., “Text”, “Image”, “Developer”, or any other name you choose)
  • add field group-sort containing a number (where 0=Text, 1=Image, 2=Developer, etc.)

That’s it. From then on, the additional type will appear in the droplist.

If you want to see how the existing types are defined, use $:/AdvancedSearch > shadows and search for “$:/Language/Docs/Types”

-e

6 Likes

Thank you Eric for the solution and the details!