Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting exception at server having abcpdf .net version 8.101 installed full vesrsion
This is the code that generate PDF from Html i.e url pdfSourceURL

I am getting 2 errors in the log file at he server
-Exception during Export to PDF: Failed to add HTML: Page load timed out.
-Exception during Export to PDF: Failed to add HTML: Gecko engine crashed.

Below is the code snippet
C#
Logs.Write("Start Genrating PDf for : " + pdfSourceURL);
                string fileName = GetFileName(TargetFolderPath, TargetFilename);
                Doc theDoc = new Doc();
                theDoc.HtmlOptions.AddLinks = true;
                theDoc.HtmlOptions.Engine = EngineType.Gecko;
                theDoc.Rect.Inset(40, 40);

                int theID;
                theID = theDoc.AddImageUrl(pdfSourceURL);
                while (true)
                {
                    theDoc.FrameRect();
                    if (!theDoc.Chainable(theID))
                        break;
                    theDoc.Page = theDoc.AddPage();
                    theID = theDoc.AddImageToChain(theID);
                }
                for (int i = 1; i <= theDoc.PageCount; i++)
                {
                    theDoc.PageNumber = i;
                    theDoc.Flatten();
                }

                if (!Directory.Exists(TargetFolderPath))
                    Directory.CreateDirectory(TargetFolderPath);
                theDoc.Save(Path.Combine(TargetFolderPath, fileName));
                Logs.Write("PDf is Genrated for : " + pdfSourceURL);
                Logs.Write("PDF Saved in the folder : " + TargetFolderPath);
                theDoc.Clear();


Please help!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900