我試圖wkhtmltopdf它完美地工作......但在服務器上我不能啓動一個進程,所以我的解決辦法是這樣的:https://github.com/gmanny/PechkinPechkin文檔/教程
但我不知道如何實現它在我的項目。 ..有沒有我可以打開並運行的樣本?
我看看這個例子:
byte[] pdfBuf = new SimplePechkin(new GlobalConfig()).Convert("<html><body><h1>Hello world!</h1></body></html>");
// create global configuration object
GlobalConfig gc = new GlobalConfig();
// set it up using fluent notation
gc.SetMargins(new Margins(300, 100, 150, 100))
.SetDocumentTitle("Test document")
.SetPaperSize(PaperKind.Letter);
//... etc
// create converter
IPechkin pechkin = new SynchronizedPechkin(gc);
// subscribe to events
pechkin.Begin += OnBegin;
pechkin.Error += OnError;
pechkin.Warning += OnWarning;
pechkin.PhaseChanged += OnPhase;
pechkin.ProgressChanged += OnProgress;
pechkin.Finished += OnFinished;
// create document configuration object
ObjectConfig oc = new ObjectConfig();
// and set it up using fluent notation too
oc.SetCreateExternalLinks(false)
.SetFallbackEncoding(Encoding.ASCII)
.SetLoadImages(false);
.SetPageUri("http://google.com");
//... etc
// convert document
byte[] pdfBuf = pechkin.Convert(oc);
但我沒有做它的工作......這看起來很容易,但不知道如何實現它? 但我看到GMAN有與它合作。
預先感謝您... :)
感謝我發現幾個小時,我寫了這個之後線程...我很着急,我需要它儘快工作...只是一個建議的代碼...使用Syncronized Pechin,而不是它也可以在Web服務器上工作...這是驚人的庫,它只是工作.. .compared到itextsharp至極我失去了很多時間想知道爲什麼我不能使它的工作是因爲LoadStyle方法只是沒有工作......並btw它的pechkin不pushkin ...:P – user1518729