rdvojmoc / DinkToPdf

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
MIT License
1.09k stars 416 forks source link

Table of contents is blank page #125

Open hungdn2703 opened 4 years ago

hungdn2703 commented 4 years ago

Hi, I'm implementing functionality to export pdf file used ASP.Net core 2.2 and DinkToPdf 1.08. In the first time run project, i can export pdf with table of content as well. But in the next time, it's blank page. Below is my code: ` [Serializable] public class TableOfContentsSettings : ObjectSettings { public TableOfContentsSettings() { this.ProduceTableOfContents = true; }

[WkHtml("isTableOfContent")]
public bool ProduceTableOfContents { get; set; }

} var doc = new HtmlToPdfDocument() { GlobalSettings = { ColorMode = ColorMode.Color, Orientation = Orientation.Portrait, PaperSize = PaperKind.A4, Margins = new MarginSettings() { Top = 10 }, DocumentTitle = "PDF Report", },

Objects = {
        new ObjectSettings()
        {
            Page = Path.Combine(currentPath, FOLDER_APP_DATA, "topReport.html"),
        },
        new TableOfContentsSettings()
        {

        },
        new ObjectSettings()
        {
            Page = Path.Combine(currentPath, FOLDER_APP_DATA, "report_new.html"),
        }
}

}; var pdf = _converter.Convert(doc);`

darkson95 commented 1 year ago

Hello! 😎 Did you ever find a solution for this issue? I tried several things, but without success.

Recrox commented 9 months ago

Same here i tried several things but no success, someone have a solution?