obsidian-pandoc
obsidian-pandoc copied to clipboard
Error when exporting image in file to .docx, saying "could not fetch resource" and "does not exist" (although it does)
I have a file that I transclude an image into, which works when I export it to PDF, but when I try doing the same with Pandoc to turn it into a docx file, I get this error message.
Any ideas? Thanks!
yeah me too having the problem if the asset folder is changed inside the obsidian settings. i am using this settings inside obsidian.
if the assets are in default directory that is in the vault location then it will export the image with out any problem
[request to author] kindly bring compatibility with other folder pls
[great plugin]
thank you for this great plugin which improved the workflow to a great extend
What's really weird is that the commandline version printed in the Obsidian error works for me, only if I run it from the commandline:
pandoc --from markdown --to pdf -o /path/to/vault/test_figure_captions.pdf --pdf-engine=xelatex /path/to/vault/test_figure_captions.md --template=paper_template.tex --resource-path="/path/to/vault/resources" --filter pandoc-fignos --filter pandoc-eqnos --citeproc
My entire markdown is here, with the resources folder under the vault (doesn't seem to work wherever I put the image files). I can't get it to fetch the images at all, with either a pdf or docx export.
# Testing
Here is a test
{#fig:orig}
Some more text for Figure @fig:orig.
As of now i am using imagegur plugin , and it will work like charm along with pandoc plugin
As of now i am using imagegur plugin , and it will work like charm along with pandoc plugin
Doesn't that upload and then embed the images? What if I don't want it to upload my images?
Not sure if this is precisely the same case, but don't wan to add duI was testing poking around a bit today to help someone on discord, and found I also could not get image exports to work, although I could've sworn they did in the past. In my case, I believe the issue is related to the plugin's HTML conversion?
- Attachments are stored in their own folder, specified in Obsidian's settings.
- Using Obsidian/wikilink type image embed, e.g.
![[Pasted image 20210910174911.png]]
- Using the "Export from HTML" plugin setting
- Get "could not fetch resource" / "openBinaryFile: does not exist" errors
- Error text indicates that Pandoc is looking for the images in the root folder, not the attachments folder
- If I move the images to the root folder, the export will work
- If I add the folder path into the image embed, the export will work, e.g.
![[Attachments/Pasted image 20210910174911.png]]
- If I add a
--resource-path
argument in the plugin, the export will fail when using the "Export from HTML" plugin setting, but will succeed if I change the image embed to standard markdown and use the "Export from Markdown" plugin setting.
Not sure if this is precisely the same case, but don't wan to add duI was testing poking around a bit today to help someone on discord, and found I also could not get image exports to work, although I could've sworn they did in the past. In my case, I believe the issue is related to the plugin's HTML conversion?
* Attachments are stored in their own folder, specified in Obsidian's settings. * Using Obsidian/wikilink type image embed, e.g. `![[Pasted image 20210910174911.png]]` * Using the "Export from HTML" plugin setting * Get "could not fetch resource" / "openBinaryFile: does not exist" errors * Error text indicates that Pandoc is looking for the images in the root folder, not the attachments folder * If I move the images to the root folder, the export will work * If I add the folder path into the image embed, the export will work, e.g. `![[Attachments/Pasted image 20210910174911.png]]` * If I add a `--resource-path` argument in the plugin, the export will fail when using the "Export from HTML" plugin setting, **but** will succeed if I change the image embed to standard markdown and use the "Export from Markdown" plugin setting.
I am having exactly the problem with yours. Do you think there is any way to change all the links of the images at one time?
I am having exactly the problem with yours. Do you think there is any way to change all the links of the images at one time?
Ozan's image in editor plugin has a batch convert function to do this, but I haven't tried it myself yet.
https://github.com/ozntel/oz-image-in-editor-obsidian
Same problem. Please kindly fix :)
I have the same problem even with markdown links and link to a folder (using a iCloud Drive folder). Export to HTML works but exporting to DocX does not.
Hi, have there been any updates on this? Thanks :)
I'm not sure it applies here but I can confirm
- the plugin seems to have a problem in the settings with spaces in the values of extra parameters like
--resource-path
see issues #66 and #81 - the
![[]]
syntax fails to produce images in the pandoc export. Changing it to equivalent[]()
solves the problem (specifying a filter in Pandoc could remedy this or even beter transforming this in the plugin)
I did find a workaround for (path) spaces in plugin settings
Same problem here, interestingly it does find some of the files but not all of them. Would be amazing to see a fix for this. Great plugin so far!
Update: If you use pandoc in the regular cli style and place images with regular markdown 
it works.
Same series of issues - image seems to have to be in the same folder as the document, but also running into errors as above when exporting Word
I had this same issue, I figured out solution for me.
by changing "New Link Format" to "Absolute path in vault" from Options --> Files & Links, worked for me.
Also my current settings for "Default location for new notes" is "Same folder as current file", this is not mandatory but just in case if solution doesn't work try changing this as well.
@HammadShamsi thank you for the tip. I changed my "New Link Format setting to "Relative path to file" which also works and also safeguards the links should I later move the files.
I have tried several versions of the pandoc plugin for obsidian. Finally, the version 0.1.1 was found to work for exporting docx file. Comparatively, can we improve the new version 0.2.5 based on 0.1.1? If anybody can fix 0.2.5, please let me know. Thank you!
Hi everyone, check out this thread and the forks/new versions of the plugin linked there: https://github.com/OliverBalfour/obsidian-pandoc/issues/88
"the ![[]] syntax fails to produce images in the pandoc export. Changing it to equivalent " can't work for me. Is there anything else I have to do. The pandoc version is 0.2.5 for me.
@aoqqf I think you will find that changing the new link format settings to "Absolute path in vault" or "Relative path to file" should work. For any old notes created prior to this setting being in place you will need to edit the links to set them to the new format.
After numerous attempts, I managed to solve this problem in the simplest way I expected. I uninstalled the plugin, restarted the computer and reinstalled the plugin. I also followed the tip to change new link format settings: "Relative path to file". In my case, Mac Os (old version), it worked.
Actually, relative paths can be supported by simply appending +rebase_relative_paths
to -f <input.format>
in the following, but you may want to add a preference menu switch for toggling this extension.
https://github.com/OliverBalfour/obsidian-pandoc/blob/8229273d854461b78d8606ba4136bf8018a478fa/pandoc.ts#L113-L116
see https://github.com/jgm/pandoc/issues/3752#issuecomment-1004352568
I'm experiencing this now. This plug in is rather useless if basic Obsidian workflow makes it impossible to export. Who wants to move all files to the root directory? Or change every single transmuted link?!!
I'm experiencing this now. This plug in is rather useless if basic Obsidian workflow makes it impossible to export. Who wants to move all files to the root directory? Or change every single transmuted link?!!
I agree, I don't know how people have managed to get this plugin to work.
My workaround was to either using pandoc from terminal or use https://github.com/mokeyish/obsidian-enhancing-export .
This plugin fails with spaces in paths so I'm not able to use it with my vault being on iCloud.
To get around the images issue, you can specify the resource_path
which is where the images will be obtained from (or your .bib file):
--resource-path ~/Library/Mobile\ Documents/com~apple~CloudDocs/ --resource-path ~/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/{path_to_your_vault}/{img_folder_in_your_vault} --citeproc --bibliography="export-data.bib" --pdf-engine=/Library/TeX/texbin/pdflatex
Hi, you can check out this thread here https://github.com/OliverBalfour/obsidian-pandoc/issues/88 where people discussed how to proceed with the plugin. Most important, I think, is the fork by phillipjohnston here https://github.com/phillipjohnston/obsidian-pandoc that you can install via BRAT. Then the plugin should work as advertised. At least it did for me.
Seems we're dealing with an issue of how Obsidian records the file path in the markup, and then pandoc is not getting what it needs, this issue is still open. I preferably hope this is solved with an approach that can support images stored in a subfolder of the main folder that's being generated from. I think that will simplify organisation and also simplify what Markup needs be included.
A WORKAROUND WITH SOME MANUAL WORK: After a bunch of jumping around I've got this working for myself (It still has some manual work involved when I add each image) but at least images are generating for me now. Here's an alpha release of a small guide I've started working on with a way to get images outputting. https://github.com/evolve2k/obsidian-pandoc-academic-word-doc-guide/#2-embeds-your-images
Well I'll appreciate if u get this of the phone I know it's on here some please get it off
Well I'll appreciate if u get this of the phone I know it's on here some please get it off
Hi. İn the files pref. Use absolutr path and turn of wiki links.
@hakantetik That's what I'm doing, but now it says "could not fetch resource". Really confused now.