使用pandoc将网页转换为pdf

时间:2016-01-19 17:51:45

标签: html pdf pandoc

我想使用pandoc将此网页转换为pdf:         http://www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery

我使用pandoc版本1.16.0.2在Windows 10 64位上。

转换上述页面时出现此错误:

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

如何解决这个问题?有什么帮助吗?

1 个答案:

答案 0 :(得分:2)

您在查找不存在的图片时遇到问题。 这是解决问题的简单方法:

  • 在Google Chrome中打开http://www.surgwiki.com/wiki/Principles_and_practice_of_cardiac_surgery
  • 右键点击网页,然后点击“另存为”。
  • 将该页面保存在计算机上的某个位置。
  • 导航到计算机上保存该页面的位置并打开HTML文件。还应创建一个与HTML同名的文件夹,但不需要进入该文件夹。
  • 使用pandoc转换网页的本地副本(刚刚打开的HTML文件)。

这应该可以解决您的问题!如果有效,请告诉我。