1 使用详解
Save()
说明:保存文档至指定路径,可指定格式。
格式:
(1)Save(string src);
(2)Save(string src,int num);
可选值:
(1)SaveFormat.Pdf,pdf格式。
(2)SaveFormat.Doc,doc格式。
(3)SaveFormat.Docx,docx格式。
2 实现代码
使用Save()保存文档至指定路径并选择文档格式(pdf,doc,docx)。
Document doc=new Document();
DocumentBuilder builder =new DocumentBuiler();
doc.Save("test.pdf",SaveFormat.Pdf);//以pdf格式保存至指定路径
doc.Save("test.doc",SaveFormat.Doc);//以doc格式保存至指定路径
doc.Save("test.docx",SaveFormat.Docx);//以docx格式保存至指定路径