Hello
i try to convert html to pdf and i get the attach error
the code is
PDFNet.Initialize();
HTML2PDF.SetModulePath(html2PdfLocation);
using (PDFDoc doc = new PDFDoc())
{
try {
HTML2PDF converter = new HTML2PDF();
HTML2PDF.WebPageSettings settings = new HTML2PDF.WebPageSettings();
settings.SetAllowPlugins(true);
settings.SetJavaScriptDelay(2000); // give 2 seconds for JS
converter.InsertFromURL(outpath, settings);
if (converter.Convert(doc))
{
int ind = files[0].LastIndexOf(’.’);
doc.Save(files[0].Substring(0, ind) + “.pdf”, SDFDoc.SaveOptions.e_linearized);
outpath = files[0].Substring(0, ind) + “.pdf”;
}
else
Console.WriteLine(converter.GetLog());
I tried too this code
if (HTML2PDF.Convert(doc, outpath))//fileConvertToPdf))//outpath))
{
int ind = files[0].LastIndexOf(’.’);
doc.Save(files[0].Substring(0, ind) + “.pdf”, SDFDoc.SaveOptions.e_linearized);
outpath = files[0].Substring(0, ind) + “.pdf”;
}
else
{
}
}
catch(Exception ex)
{
}
}
Waiting for a quick reply
thank
Tehila