Comments (36)
It works if you give a complete relative path to the picture.
E.g
![Picture](./assets/img1.png)
This seems to work and the image is displayed in the PDF that is generated as well.
from markdown-pdf.
+1 any update on this?
from markdown-pdf.
Hi,
I right now have the exact same problem with Atom 1.8.0 on Windows 8.1 x64.
But the "file://" workaround doesn't work either. I simply cannot insert any image.
In preview they are shown correctly, but the converted pdf does not contain them.
from markdown-pdf.
I still have this problem, Windows 10. Atom 1.23.2 and markdown pdf 2.1.0
I get the preview correctly but generated pdf has no images at all (not even the alt is generated as a place holder), do we know how to make this work?
Thanks in advance :)
from markdown-pdf.
Now we know that we need file://absolute/path/to/image
. I will make a patch for this project to convert paths to this form before making the pdf. This will let users to get the correct pdf to match the output in the preview pane.
Thanks once again 😸
Update: @oldratlee: I linked the wrong repo last time 😮. Will be making a patch for this in the next little bit.
from markdown-pdf.
Hi everyone,
This path format worked for me for both the markdown preview, and the markdown to pdf package.
![](../images/triangle-client-paas-server.png)
Using Windows 10, Atom 1.53.0 x64
me too! putting .. before the path did the job. Eg. ![image] (../graphs/activity_plot.png)
Thanks!
from markdown-pdf.
This works for me, I am on OS X Yosemite. What OS are you using?
from markdown-pdf.
Sorry for not providing my environment info. I'm on OS X Yosemite too.
My example in issue is not precise(sorry again 😿 ), my actual test image using local path, eg:
![](path/to/image.png)
This image element can work in atom markdown preview(and in github web page), but missing in exported pdf file.
Example
Preview example
PS: Example markdown file path: https://github.com/oldratlee/translations/tree/master/10-things-you-didnt-know-about-java
Exported pdf example
My environment info
OS: OS X Yosemite 10.10
Atom: 0.146.0
Markdown pdf: 1.1.1
from markdown-pdf.
Indeed, I get this error as well when trying to include a local image, but not with a remote (i.e. http://) image.
I will play around with this and let you know what I find out.
Thanks for the bug report as well 🐛
Update:
It seems like the problem is that marked
does not support relative paths to images, while markdown-preview
does. In your example, if you replace the relative path java-mystery.jpg
with the absolute path, prepended by file://
, you will get the image in pdf output, but not in the preview window.
Notice that preview is incorrect, but this outputs the image in the pdf for me.
from markdown-pdf.
updated to 1.2.2
, works perfectly! 👏
Thank you for your support and this useful and terrific atom package!
from markdown-pdf.
No problemo 😀
from markdown-pdf.
I'm still running into this issue with version 1.2.6. I'm running Atom 0.155.0 on Windows 7. My image tag looks like this: ![](screenshots/a.png)
. Anything else I can do to help troubleshoot?
from markdown-pdf.
@zmb3
Hey! Can you provide a screenshot? I'd just like to see your markdown vs the output.
Thanks for the report 🐛
from markdown-pdf.
@travs It looks exactly like the screenshots originally reported in this issue.
from markdown-pdf.
@zmb3
Ok, the problem is to do with windows vs *nix URI schemes.
I am publishing a patch right now with a quick hack that may fix this, but don't get your hopes up.
If you or someone else with a windows box could update to 1.2.10
and give it a shot I would greatly appreciate it.
If it ends up being a no-go I'll go for the long fix and get this resolved once and for all 💪
from markdown-pdf.
No such luck. 1.2.10 is showing the same behavior.
from markdown-pdf.
I thought I knew what the issue was but now I'm not so sure...
Had a chance to try this on two windows machines today, and it worked fine for me on both Windows 7 and Windows 8.1, using the same version of Atom as you used (0.155.0). There seems to be no problem with URIs.
The only way I could get the same output as you was to point to a non-existent .png
.
You certainly have a .png
in that folder, so that isn't the problem.
I was using Windows 7 home edition service pack 1 to be precise; what are you using?
Also, try updating Atom to the latest version and see if it works.
I'm really at a loss on this one 😕
from markdown-pdf.
Hmm.. I just tried 1.2.10 in Atom 0.169.0 on Windows 8.1 x64, and it seems to work fine!
This is not the setup that I was previously having trouble with. That was Windows 7 Enterprise with Atom 0.155.0. I'll give it another try on that PC on Monday with the latest version of Atom.
from markdown-pdf.
Same for me on environment below.
- Windows 10
- Atom 1.8.0
- markdown-pdf 1.5.0
PATH to the image is relative like this, and happens on all images.
![図#2-ref](images/20_datastructures-02-ref.png)
from markdown-pdf.
Same problem for me...
Windows 7 Pro 64-bit
Atom 1.13.0 ia32
from markdown-pdf.
I am still having this problem
from markdown-pdf.
Hi !
Same problem here too...
Windows 10 Pro 64 bit
Atom 1.9.9
markdown-pdf 1.5.0
from markdown-pdf.
Same Problem!
Win 10 x64
Atom 1.15.0
markdown-pdf 1.5.0
from markdown-pdf.
Me too! Any solutions anybody?
from markdown-pdf.
Windows 10. Atom 1.16.0 x64. markdown pdf 1.5.0
from markdown-pdf.
Does this module use pandoc in anyway? My images are png's. They load fine in the preview don't convert to pdf. Pandoc preview of the document fails to load the images. I wonder if they're connected.
from markdown-pdf.
Hi,
I right now have the exact same problem with Atom 1.8.0 on Windows 8.1 x64.
But the "file://" workaround doesn't work either. I simply cannot insert any image.
In preview they are shown correctly, but the converted pdf does not contain them.
Try using the full path, but now without "file://" in front of it, that worked for me.
e.g. /home/username/images/fig.png instead of file:///home/username/images/fig.png
from markdown-pdf.
I tried as @janjaapmeijer suggested and it works. But it's not ideal because I have my md file in github. If I use full file path, it will not work for other people who fetch my repo. I wish we can do it without giving full path.
from markdown-pdf.
In windows 10 , vscode , markdown
When it's
![pictrure](picture\gan_generated_image_epoch_80.png)
I get the preview correctly but generated pdf has no images
but when I use the /
, like ![pictrure](picture/gan_generated_image_epoch_80.png)
it both works.
from markdown-pdf.
It works if you give a complete relative path to the picture.
great tip, thanks!
from markdown-pdf.
Hi,
I am still not able to view images in the PDF. My md file is in a output folder that is parallel to project src folder.
and the images are under src/images/images_name.png.
when giving the path egs -
![](../src/images/plugins.png)
the preview is available in VS Code but pdf is not displaying the image.
Using Windows 10, VSCode.
from markdown-pdf.
Hi everyone,
This path format worked for me for both the markdown preview, and the markdown to pdf package.
![](../images/triangle-client-paas-server.png)
Using Windows 10, Atom 1.53.0 x64
from markdown-pdf.
For anyone elses benefit that got stuck like me, I had folder structure:
app\guide
files in folder guide:
user-guide.md
login.png
I tried all sorts:
![Worked in Preview](login.png)
![Neither](./app/guide/login.png)
![Neither](/app/guide/login.png)
![Neither](.app/guide/login.png)
![Neither](app/guide/login.png)
![Worked in PDF](guide/login.png)
![Worked in Preview](/guide/login.png)
![Neither](.guide/login.png)
![Worked in PDF](./guide/login.png)
I was running the command in gitbash from the app folder:
markdown-pdf guide/user-guide.md
THEN I ran gitbash from the guide folder!
markdown-pdf user-guide.md
And then this worked in both (and github):
also make sure that your file name isn't login.PNG... this will work in preview and pdf but not on github
![Praise the lord](login.png)
Maybe I am just an idiot but hopefully this may help a random passer by.
Using Windows 10, Visual studio Code 1.52.1, markdown-pdf v10.0.0
from markdown-pdf.
I got the same problem, do you guys have any idea how to fix it?
from markdown-pdf.
Hi everyone,
This path format worked for me for both the markdown preview, and the markdown to pdf package.
![](../images/triangle-client-paas-server.png)
Using Windows 10, Atom 1.53.0 x64me too! putting .. before the path did the job. Eg. ![image] (../graphs/activity_plot.png)
Thanks!
for me it needed to be a single . as the images folder is on the same level, rather then on the folder level above.
thanks for your help!
from markdown-pdf.
Hi everyone,
This path format worked for me for both the markdown preview, and the markdown to pdf package.
![](../images/triangle-client-paas-server.png)
Using Windows 10, Atom 1.53.0 x64me too! putting .. before the path did the job. Eg. ![image] (../graphs/activity_plot.png)
Thanks!
Putting .. before image path worked for me
Thanks
Was losing my mind over this
from markdown-pdf.
Related Issues (20)
- the images path over length HOT 2
- Conversion fails with `Error: ENOENT: ...` HOT 2
- Unmaintained repository ? HOT 4
- Rewrite the project HOT 2
- Misleading error when trying to convert from a non-editor pane
- Custom user styles doesn't work HOT 3
- Lists with sub-lists do not export to pdf correctly HOT 1
- NBSP Shows Instead of Spaces HOT 2
- Not able to export to other formats than pdf
- Failed to activate the markdown-pdf package HOT 2
- Does not render footnotes (e.g. gitlab flavored markdown)
- Can't disable syntax highlighting in code blocks
- Cannot read property 'pre' of undefined
- How can i use markdown-pdf from the external command line?
- Uncaught Error: Cannot find module 'less'Require stack:- $ATOM_HOME/packages\markdown-pdf\lib\a...
- List numbering is not as expected
- Links to sections of the document do not work in the PDF
- Each line in markdown is written as a new line and not as a paragraph in the PDF
- Missing table element in convert precess
- Base 64 images in markdown are not displayed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown-pdf.