Giter VIP home page Giter VIP logo

Comments (36)

Mihier-Roy avatar Mihier-Roy commented on June 10, 2024 11

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.

cmacdonnacha avatar cmacdonnacha commented on June 10, 2024 6

+1 any update on this?

from markdown-pdf.

DeastinY avatar DeastinY commented on June 10, 2024 5

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.

markdrake avatar markdrake commented on June 10, 2024 4

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.

travs avatar travs commented on June 10, 2024 2

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.

amasud08 avatar amasud08 commented on June 10, 2024 2

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.

travs avatar travs commented on June 10, 2024

This works for me, I am on OS X Yosemite. What OS are you using?

from markdown-pdf.

oldratlee avatar oldratlee commented on June 10, 2024

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

preview

PS: Example markdown file path: https://github.com/oldratlee/translations/tree/master/10-things-you-didnt-know-about-java

Exported pdf example

pdf

My environment info

OS: OS X Yosemite 10.10
Atom: 0.146.0
Markdown pdf: 1.1.1

from markdown-pdf.

travs avatar travs commented on June 10, 2024

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.

screen shot 2014-11-28 at 7 27 04 pm
Notice that preview is incorrect, but this outputs the image in the pdf for me.

from markdown-pdf.

oldratlee avatar oldratlee commented on June 10, 2024

updated to 1.2.2, works perfectly! 👏

Thank you for your support and this useful and terrific atom package!

from markdown-pdf.

travs avatar travs commented on June 10, 2024

No problemo 😀

from markdown-pdf.

zmb3 avatar zmb3 commented on June 10, 2024

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.

travs avatar travs commented on June 10, 2024

@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.

zmb3 avatar zmb3 commented on June 10, 2024

@travs It looks exactly like the screenshots originally reported in this issue.

image

from markdown-pdf.

travs avatar travs commented on June 10, 2024

@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.

zmb3 avatar zmb3 commented on June 10, 2024

No such luck. 1.2.10 is showing the same behavior.

from markdown-pdf.

travs avatar travs commented on June 10, 2024

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.

zmb3 avatar zmb3 commented on June 10, 2024

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.

ebiken avatar ebiken commented on June 10, 2024

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.

andersab avatar andersab commented on June 10, 2024

Same problem for me...
Windows 7 Pro 64-bit
Atom 1.13.0 ia32

from markdown-pdf.

imcorcor avatar imcorcor commented on June 10, 2024

I am still having this problem

from markdown-pdf.

6l20 avatar 6l20 commented on June 10, 2024

Hi !
Same problem here too...
Windows 10 Pro 64 bit
Atom 1.9.9
markdown-pdf 1.5.0

from markdown-pdf.

felixnext avatar felixnext commented on June 10, 2024

Same Problem!
Win 10 x64
Atom 1.15.0
markdown-pdf 1.5.0

from markdown-pdf.

eddy-ojb avatar eddy-ojb commented on June 10, 2024

Me too! Any solutions anybody?

from markdown-pdf.

eddy-ojb avatar eddy-ojb commented on June 10, 2024

Windows 10. Atom 1.16.0 x64. markdown pdf 1.5.0

from markdown-pdf.

eddy-ojb avatar eddy-ojb commented on June 10, 2024

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.

janjaapmeijer avatar janjaapmeijer commented on June 10, 2024

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.

scookies avatar scookies commented on June 10, 2024

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.

SpecialMay avatar SpecialMay commented on June 10, 2024

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.

luc4leone avatar luc4leone commented on June 10, 2024

It works if you give a complete relative path to the picture.

great tip, thanks!

from markdown-pdf.

srbgupta avatar srbgupta commented on June 10, 2024

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.

sergio-nunez-meneses avatar sergio-nunez-meneses commented on June 10, 2024

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.

jwamoney avatar jwamoney commented on June 10, 2024

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.

kathy330 avatar kathy330 commented on June 10, 2024

I got the same problem, do you guys have any idea how to fix it?

from markdown-pdf.

Skiddoh avatar Skiddoh commented on June 10, 2024

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!

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.

TrentuQuiyum avatar TrentuQuiyum commented on June 10, 2024

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!

Putting .. before image path worked for me
Thanks
Was losing my mind over this

from markdown-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.