Office/Pdf格式转换,Net5环境下Aspose最新版21.8全系列,去水印等

Posted 神色自若

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Office/Pdf格式转换,Net5环境下Aspose最新版21.8全系列,去水印等相关的知识,希望对你有一定的参考价值。

var byteKey = Convert.FromBase64String("xxxxxx");

            //注册,实现去水印            
            new Aspose.Pdf.License().SetLicense(new MemoryStream(byteKey));
            new Aspose.Cells.License().SetLicense(new MemoryStream(byteKey));
            new Aspose.Words.License().SetLicense(new MemoryStream(byteKey));
            new Aspose.Slides.License().SetLicense(new MemoryStream(byteKey));
            string wordFile = "wordFile.docx";
            string excelFile = "excelFile.xlsx";
            string pptFile = "pptFile.pptx";
            string pdfFile = "pdfFile.pdf";
            Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
            workbook.Worksheets.Add();
            workbook.Worksheets[0].Cells[1, 1].Value = "excelTest";
            workbook.Save(excelFile);
            workbook.Save(wordFile, Aspose.Cells.SaveFormat.Docx);
            workbook.Save(pptFile, Aspose.Cells.SaveFormat.Pptx);
            workbook.Save(pdfFile, Aspose.Cells.SaveFormat.Pdf);
            Console.WriteLine("保存成功!");

示例代码不包含key,下面有获取key方法

office所有版本2003-2022,Pdf所有版本均支持。

pdf

 word

excel

 

powerpoint

 

 加微信25489181

 

以上是关于Office/Pdf格式转换,Net5环境下Aspose最新版21.8全系列,去水印等的主要内容,如果未能解决你的问题,请参考以下文章