Getting error while generate PDF

I am generating the PDF from html for that I have written below code for it.


Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
pdf.PageSetup.Margin.Top = 5;
pdf.PageSetup.Margin.Bottom = 5;
pdf.BindHTML(srcPDF);
pdf.Save(destinationPath);

and value for srcPDF = "

Fee Calculation - FS

"

I am getting below error in pdf.BindHTML(srcPDF); line

Exception: Index and length must refer to a location within the string.
Parameter name: length

The same code is working if srcPDF content is long rather than I mentioned. Can you please help me to sortout this problem ASAP.

Thanks,

Jignesh

Hi Jignesh,


Thanks for your inquiry. Please use new DOM approach for HTML to PDF conversion, it is more efficient and improved. It will help you to accomplish the task.


Please feel free to contact us for any further assistance.

Best Regards,