我尝试了wkhtmltopdf完美的工作...但在服务器上我无法启动一个过程所以我的解决方案将是这样的:https://github.com/gmanny/Pechkin
但是我不知道如何在我的项目中实现它......我可以打开并运行任何样品吗?
我看了一下这个例子:
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(); …Run Code Online (Sandbox Code Playgroud)