0

I am using wkhtmltopdf 0.12.5 with NReco (Asp.net core). I have set TOC to true

HtmlToPdf.GenerateToc = true;
HtmlToPdf.TocHeaderText = "INNEHÅLLSFÖRTECKNING";

I am getting document outline with the proper header text but toc is not generated. Am I missing anything?

Jeeva J
  • 3,173
  • 10
  • 38
  • 85

1 Answers1

1

This is a known issue in wkhtmltopdf 0.12.5 release: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3989

It fix that it is enough to upgrade to latest 0.12.6 release (or downgrade to 0.12.4 if this is not possible for some reason).

Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34
  • where I can download wkhtmltopdf binaries for azure Linux? – Jeeva J Mar 16 '21 at 12:27
  • I don't know which binary i can use for azure linux.. – Jeeva J Mar 16 '21 at 13:54
  • If this is Azure Apps Service Linux VM most likely it is Debian-based; to check that you may connect to your Linux VM with SSH -- if you're able to use 'apt-get' it is definitely Debian-based. – Vitaliy Fedorchenko Mar 17 '21 at 06:40
  • Do we need to get library after installed in Linux? I have done extraction using 7zip. It doesn't work for me – Jeeva J Mar 19 '21 at 11:45
  • When you use NReco.PdfGenerator.LT nuget package wrapper expects that you'll deploy/install wkhtmltopdf with your .NET app. In case of Linux deployment instructions depend on Linux distribution you use. If this is Debian-based Linux (but not Ubuntu) wkhtmltopdf should be installed with .deb package from the official downloads (https://wkhtmltopdf.org/downloads.html). It is not enough to copy 'wkhtmltopdf' executable, it has many dependencies. – Vitaliy Fedorchenko Mar 19 '21 at 12:09
  • Yeah, I have done that part. I have installed debian-based linux and got the binaries. When I export it in windows, it did not work. – Jeeva J Mar 23 '21 at 04:18