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();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)