简体   繁体   English

使用Pandoc将网页转换为pdf

[英]Converting webpage to pdf with pandoc

I want to convert this web page to pdf using pandoc: http://www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery 我想使用pandoc将此网页转换为pdf: http : //www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery

I am on Windows 10 64 bit with pandoc version 1.16.0.2. 我在Windows 10 64位上使用pandoc版本1.16.0.2。

While converting the above page I get this error: 在转换以上页面时,出现此错误:

pandoc: Could not find image `/w/images/thumb/Ch57-fig1.jpg/180px-Ch57-fig1.jpg', skipping...
pandoc: Could not find image `/w/skins/common/images/magnify-clip.png', skipping...
pandoc: Could not find image `/w/images/thumb/Ch57-fig2.jpg/180px-Ch57-fig2.jpg', skipping...
pandoc: Could not find image `/w/skins/common/images/magnify-clip.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/BlogMarks.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/del.icio.us.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/digg.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Fark.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Furl.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Newsvine.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/reddit.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Segnalo.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Simpy.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Slashdot.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/smarking.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Spurl.png', skipping...
pandoc: Could not find image `/w/skins/common/images/sharethis/Wists.png', skipping...
pandoc: Could not find image `/w/skins/common/images/poweredby_mediawiki_88x31.png', skipping...
! Package pdftex.def Error: File `/w/images/thumb/Ch57-fig1.jpg/180px-Ch57-fig1
.jpg' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.480 ...thumb/Ch57-fig1.jpg/180px-Ch57-fig1.jpg}}

pandoc: Error producing PDF

How to solve this problem? 如何解决这个问题呢? Any help? 有什么帮助吗?

Your having issues locating images that don't exist. 您在查找不存在的图像时遇到了问题。 Here's an easy way to get around that: 这是解决此问题的简单方法:

  • Open http://www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery in Google Chrome. 在Google Chrome浏览器中打开http://www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery
  • Right click on the web page and click 'Save as'. 右键单击网页,然后单击“另存为”。
  • Save that page somewhere on your computer. 将该页面保存在计算机上的某个位置。
  • Navigate to where that page was saved on your computer and open the HTML file. 导航到该页面在计算机上的保存位置,然后打开HTML文件。 A folder with the same name as the HTML should also be created, but there is no need to go into that. 还应该创建一个与HTML具有相同名称的文件夹,但是没有必要进入该文件夹。
  • Convert the local copy of the web page (the HTML file you just opened) using pandoc. 使用pandoc转换网页的本地副本(刚打开的HTML文件)。

This should fix your problem! 这应该可以解决您的问题! Let me know if it works. 让我知道它是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM