Skip to content

markglibres/cad.documents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cad.documents

NuGet Package: CAD.Documents
PM> Install-Package CAD.Documents
https://www.nuget.org/packages/CAD.Documents/
----------------------------------------------------------------
NuGet Dependencies:

Json.Net, DocX, HtmlAgilityPack, iTextSharp, iTextSharp XML Worker, OpenXml Power Tools
---------------------------------------------------------

Namespace: CAD.Core.Tools
----------------------------------------------------
Usage:

var textToReplace = new Dictionary<string,string>();

//replaces any text from doc file enclosed with {}.. example: {Firstname}
//default format {*}
//this is optional
var textToReplaceFormat = "{{*}}";
var docFile = "C:\test.doc";
var pdfFile = "C:\test.pdf";
var htmlFile = "C:\test.html";

//convert to pdf
DocTools.WordManager.ConvertToPdf(docFile,pdfFile);

//replace text then save as doc
DocTools.WordManager.ReplaceTextToWord(textToReplace, docFile, pdfFile);

//replace text and convert to pdf with replace format
DocTools.WordManager.ReplaceTextToPdf(textToReplace, docFile, pdfFile, textToReplaceFormat);

//replace text then convert to html
DocTools.WordManager.ReplaceTextToHtml(textToReplace, docFile, pdfFile, textToReplaceFormat);

//convert html to pdf
DocTools.PdfManager.ConvertFromHtml(htmlFile,pdfFile);

//convert doc to html
DocTools.XmlManager.ConvertWordToHtml(docFile,htmlFile);

About

Word to PDF with optional text replace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages