[BUG] Pandoc cannot find image file unless full relative path is used
See original GitHub issueHello! I was trying to convert one of my files to PDF, I received the following error
The thing is, that picture isn’t in the root folder, it’s in a nested folder called __Assets
.
The full path is C:\Users\Username\Documents\[[Obsidian]]\Folks and Tales\Ash In The Snow\PCs\__Assets
If the full relative path (Ash In The Snow/PCs/__Assets/Axiom.png
) is specified, then works. The only way to do this in obsidian (that I know of?) is by having multiple files by the same name, which forces obsidian to have a full relative link to that exact file.
Is there any way to work around this issue? I can provide any files or my exact file structure if needed.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:5
Top Results From Across the Web
Why does Pandoc not retrieve the image file? - Stack Overflow
Never use absolute paths unless you absolutely have to. Use relative paths whenever you can. Put your image under the same directory as...
Read more >Relative paths in image links and Pandoc - Marked Support
This time I'm writing because I'm facing problems with image links in markdown docs to be processed by Pandoc. which shows why the...
Read more >MANUAL.pdf - Pandoc
The original file paths are used if they are relative paths not containing ... Otherwise filenames are constructed from the SHA1 hash of...
Read more >Pandoc "--resource-path=" not working!
option does not give me any error message but still pandoc CANNOT find the image file. It does not matter what directory I...
Read more >16.6 The working directory for R code chunks | R Markdown ...
If you use the Rmd document directory as the working directory for code chunks (knitr's default), you assume that file paths are relative...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
subscribing to this one. when in Obsidain Options, Files and Links, I have defined a subfolder name for images, “attachments” for example, all pictures are in /attachments folder. Obsidian sees them and displays render them correctly. Pandoc plugin cannot see them and complains those binaries do not exist.
I had a similar problem on Macos. Hope my solution translates to Windows… I tried to specify the image folder by using the parameter in the plugin settings:
--resource-path='[abs_path_name_containing_spaces]'
but it failed with the (no such file or directory) error. Even when I escaped the spaces. Using the same parameter on commandline with pandoc it did work. The problems seems to be that parameters cannot contain spaces when you specify them in the settings for this plugin. The path to the Obsidianvault when placed in iCloud allways contains at least one space. So removing the spaces in the path is impossible. I discovered a pandoc parameter so worked around it by specifying instead:
--defaults=[path_to_yaml_file_no_spaces]
I put an
.pandoc-obs.yaml
file (you can use any filename withoud spaces) in my homedir (no spaces in the path there). And the yaml-file contains the parameter in YAML syntax:resource-path: ["/Users/ncdegroot/Library/Mobile Documents/iCloud~md~obsidian/Documents/Notes/00-Meta/03-Attachments"]
That worked. At least after I changed the ![[image_file_name_no_path]] links to the more MD standard !()[image_filename_no_path] to get the image to appear in the generated .docx file. To create .PDF I still need to install some more latex stuff, but thats another story.Hope its helps!