c# - Running a TuesPechkin converter more than once -


i'm using tuespechkin web application, i'm testing locally on iis vs2013. user clicks button , page's current html saved pdf file, emailed out. process going run regularly site's data changes.

when converter.convert(document) first runs, converts without problem. every subsequent attempt, however, results in process hanging , me needing restart vs.

below default code i've been using test.

public void makepdf() {     var document = new htmltopdfdocument     {         globalsettings =         {             produceoutline = true,             documenttitle = "pretty websites",             papersize = paperkind.a4, // implicit conversion pechkinpapersize             margins =             {                 = 1.375,                 unit = tuespechkin.unit.centimeters             }         },         objects = {             new objectsettings { htmltext = "<h1>pretty websites</h1><p>this might take bit convert!</p>" }         }     };      iconverter converter =         new threadsafeconverter(             new pdftoolset(                 new win32embeddeddeployment(                     new tempfolderdeployment())));      byte[] result = converter.convert(document); } 

can point me in right direction on this? of troubleshooting far has led discussions on threading , pooling, no concrete code solutions running tuespechkin more once.

have tried threadsafeconverter? standardconverter suitable small console apps.

iconverter converter =     new threadsafeconverter(         new remotingtoolset<pdftoolset>(             new win32embeddeddeployment(                 new tempfolderdeployment())));  byte[] result = converter.convert(document); 

note should keep converter somewhere static, or singleton instance (as mentioned here).


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -