GlobalConfig config = new GlobalConfig();
            SimplePechkin pechkin = new SimplePechkin(config);
            ObjectConfig objectConfig = new ObjectConfig();
            objectConfig.SetPrintBackground(true)
                .SetLoadImages(true)
                .SetAffectPageCounts(true)
            .SetPageUri("http://localhost:44354/Template/HTMLToPDF?ID=16");
            byte[] bytePDF = pechkin.Convert(objectConfig);

            //保存
            string uploadPath = HttpContext.Current.Server.MapPath("~/App_Data/");
            using (FileStream fs = new FileStream(uploadPath+ "test.pdf", FileMode.Create, FileAccess.Write))
            {
                fs.Write(bytePDF, 0, bytePDF.Length);

            }

 

需引用

using Pechkin;

相关文章:

  • 2021-08-22
  • 2021-10-08
  • 2021-05-29
  • 2021-11-17
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2021-06-03
  • 2022-12-23
  • 2021-04-04
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
相关资源
相似解决方案