External images WITHOUT Node.js

145 views
Skip to first unread message

JWHoneycutt

unread,
Apr 9, 2017, 2:50:38 PM4/9/17
to TiddlyWiki

I created a link to an external image manually (and Now to demonstrate my lack of true understanding):


My setup: 


I am using TW5 version 5.1.13 stored in Dropbox and a laptop running macOS Sierra version 10.12.4 that links to the TW5 files using TiddlyDesktop version 0.0.8

My TW5's are kept in Dropbox folder ./Dropbox/TW5/

My Images are kept in Dropbox folder ./Dropbox/Images/ (contains lots of JPEG's and PDF's)


I SHOULD be able to use a Widget:

ImageWidget - don't understand it - ImageWidget and ExternalImages documentation from (5.1.14 Pre-release) re: the _canonical_uri field - really needs a basic example for me to follow and copy


I have successfully used a Link:

Place this in the body of a text tiddler: [ext[Picturename|../Images/Picturename.jpeg]] - This creates a link that would show me the image if I clicked on it


A better solution for me renders the picture right into the story river:

Create a new tiddler with no body text, just a title, tiddler type "image/jpeg" and a field: _canonical_uri with the value ../Images/Picturename.jpeg


No such luck with PDF's:

The Link [ext[Picturename|../Images/Picturename.pdf]] does create a link, but clicking the created link does nothing - I have tried changing my default "opens with" program from Adobe Acrobat Reader to Preview - still doesn't work for PDF's


I also tried a new tiddler with no body text, just a title, tiddler type: "image/pdf" and a field: _canonical_uri with the value ../Images/Picturename.pdf - but I think tiddler type: "image/pdf" is not accepted (it would be nice if this worked just like "image/jpg"...)


I also tried a new tiddler with no body text, just a title, tiddler type: "application/pdf" and a field: _canonical_uri with the value ../Images/Picturename.pdf - but this renders a blank frame


I also tried Method 1 from http://tobibeer.github.io/tb5/#Embedded_External_PDF - but I don't understand step 3: "as needed, embed in another tiddler via PDF Tiddler Title" - maybe I need that?


I also tried Method 2 from http://tobibeer.github.io/tb5/#Embedded_External_PDF - I imported a macro titled "$:/.tb/macros/pdf" and tagged "$:/tags/Macro" - but I can't figure out where I am supposed to put <<pdf "http://bit.ly/18mukKq">> - either into

  • the body text of the shaddow tiddler "$:/.tb/macros/pdf",
  • or the body text of a new tiddler with tiddler type: "application/pdf" and a field: _canonical_uri with the value ../Images/Picturename.pdf
  • or someplace else
  • or <<pdf "http://bit.ly/18mukKq">> is just an example I am not supposed to be typing anywhere
  • or it's automatic when I save and reload - I have tried all of these...

P.S. I do not want to convert my PDF's to JPEG's (too many of them and other people/software are looking for PDF's)


I am considering removing Adobe Acrobat from my laptop in case it is overriding my "opens with" preferences...

Mark S.

unread,
Apr 9, 2017, 5:34:13 PM4/9/17
to TiddlyWiki
This one should work:


I also tried a new tiddler with no body text, just a title, tiddler
type
: "application/pdf" and a field: _canonical_uri with the value ../Images/Picturename.pdf - but this renders a blank frame

If it doesn't work, perhaps try a different browser? The browser has to be able to display PDFs with its own internal viewer.

For images, this should work:

[img[Picturename|../Images/Picturename.jpeg]]

AFAIK, the [ext[xxx]] syntax only creates links.

Good luck,
Mark

Mat

unread,
Apr 9, 2017, 6:06:11 PM4/9/17
to TiddlyWiki
 the _canonical_uri field - really needs a basic example for me to follow and copy

JWHoneycutt

unread,
Apr 9, 2017, 7:26:24 PM4/9/17
to TiddlyWiki
@Mark S. 

Thank you for the thoughts. 


If it doesn't work, perhaps try a different browser?

I default to Firefox, but also routinely use Safari and Google Chrome - since I am working with a TW5.html, does this mean I should try setting a different default browser? I have been trying to set a different default app to load PDF's - and even though I deleted (thought I did) Adobe Acrobat Reader - I still get an Adobe error message every time I try this link
 
For images, this should work:

[img[Picturename|../Images/Picturename.jpeg]]

Assuming you meant ..Picturename.PDF]] 


AFAIK, the [ext[xxx]] syntax only creates links.

I see... still hoping to render inside the story river - but I'll take what I can

Thanks Mark S.

Mat

unread,
Apr 9, 2017, 7:42:13 PM4/9/17
to TiddlyWiki
Just curious, dioes any of this succeed;

- put the images in the same folder as the TW.
- open the pdf in the browser, without the TW. If this doesn't work, then I don't think it'll work in TW either.

Also Dropbox recently did some changes, could that be causing problems: https://www.dropbox.com/help/16

<:-)

Mark S.

unread,
Apr 9, 2017, 8:27:22 PM4/9/17
to TiddlyWiki
No, sorry. I was just talking about images. For PDFs, you either have to use the _canonical_uri (isn't that a snazzy name?) or do some html embedding in an iframe tag. That is what Tobias' macro is supposed to help you with -- putting things into an iframe.

The first approach of course, as Mat noted, is to see if your browser can display PDF's in the browser at all. Perhaps navigate from within your browser and attempt to open the PDF. If The browser can't open the PDF, neither can TW (TW just leverages existing PDF magic -- doesn't make its own).

I believe Firefox has its own internal PDF viewer, so it might be a better browser to test on. Other browsers need to use a plugin to interface with an external PDF viewer like Acroread. Or at least that is my (probably broken) understanding.

I couldn't get Tobias' PDF macro to work with the address he used (maybe because it has to be translated by bit.ly) , but it worked fine with local PDFs which is your use-case and the situation you would have using local dropbox files. Even though they're synched by dropbox, they're really just local files.

So you would type into the body of a tiddler something like:

<<pdf "../Images/MyPDF.pdf">>

Good luck!
Mark

On Sunday, April 9, 2017 at 4:26:24 PM UTC-7, JWHoneycutt wrote:
@Mark S. 

JWHoneycutt

unread,
Apr 9, 2017, 11:26:41 PM4/9/17
to TiddlyWiki

@Mat and Mark S.

Wow - I didn't know that you could drag a pdf file onto the address bar of a browser (Firefox at least) and it would load it.

I started removing variables - moved a few pdf files into the same directory as TW5.html,

<a href="./Picturename.pdf" rel="noopener noreferrer">Picturename.pdf image link</a>


Apparently I have a different problem, somehow related to Adobe Acrobat Reader DC - even though I have changed by default "opens with" association for PDF's

Acrobat gives a persistent error everytime I click the created link - then loads a large black frame - then closes the TW5.html file

I guess I don't know how to disconnect Adobe from the links in TW5??

Mark S.

unread,
Apr 9, 2017, 11:49:44 PM4/9/17
to TiddlyWiki
When you say you've changed associations, do you mean in the operating system, or in the browser? I think it's in the browser that you want. Under options -> applications. On mine, Portable Document Format is set to "Preview in Firefox"

Good luck,
Mark
Reply all
Reply to author
Forward
0 new messages