"Cannot generate PDF: The filename or extension is too long" while generating pdf

289 views Asked by At

I am generating pdf using the following method with NRECO. but while i am generating, I am getting the issue "Cannot generate PDF: The filename or extension is too long".

I gave permission as everyone for the path where I am saving. My sample path is "D:/PdfSample"

HtmlToPdf.GeneratePdfFromFiles(new[] {
                new WkHtmlInput(coverpage),
                new WkHtmlInput(htmlContent)
                {
                 PageHeaderHtml = header
                }
            }, null, path);
1

There are 1 answers

0
Vitaliy Fedorchenko On

GeneratePdfFromFiles method expects that inputs are local files (or URLs) and the path (or URL) should be passed in WkHtmlInput constructor. In your case, it seems you're trying to provide here HTML content itself.