Last active
April 6, 2020 14:12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
try | |
{ | |
//Setting up source document template (Email or Word Document) | |
const String strDocumentTemplate = "Word Templates/DynamicDocInsert.docx"; | |
//Setting up destination for reports | |
const String strDocumentReport = "Word Reports/DynamicDocInsert Out.docx"; | |
//Assemble the document | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), | |
CommonUtilities.SetDestinationDocument(strDocumentReport), new DataSourceInfo(CommonUtilities.GetOuterDocumentFolder("OuterDocument.docx"), "document_expression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
try | |
{ | |
//Setting up source document template (Email or Word Document) | |
const String strDocumentTemplate = "Word Templates/DynamicImageDemo.docx"; | |
//Setting up destination for reports | |
const String strDocumentReport = "Word Reports/DynamicImageDemo Out.docx"; | |
//Assemble the document | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), | |
CommonUtilities.SetDestinationDocument(strDocumentReport), new DataSourceInfo(CommonUtilities.GetImageFolder("no-photo.jpg"),"image_expression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
//Setting up source document template | |
const String strDocumentTemplate = "Markdown Templates/ReadMe.md"; | |
//Setting up destination Markdown reports | |
const String strDocumentReport = "Word Reports/ReadMe Out.docx"; | |
//Setting up description variable | |
const string description = "GroupDocs.Assembly for .NET is a class library that enables you to generate documents in popular " + | |
"office and email file formats based upon template documents and data obtained from various sources " + | |
"including databases, XML, JSON, OData, objects of custom .NET types, external documents, and more."; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
//Assemble Document | |
assembler.AssembleDocument( | |
CommonUtilities.GetSourceDocument(strDocumentTemplate), | |
CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo("GroupDocs.Assembly for .NET", "product"), | |
new DataSourceInfo(description, "description")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
try | |
{ | |
//Setting up source document template (Email or Word Document) | |
Stream sourceStream = File.OpenRead(CommonUtilities.GetSourceDocument("Word Templates/ReadMe.docx")); | |
//Setting up destination Markdown Reports | |
FileStream targetStream = File.Create(CommonUtilities.SetDestinationDocument("Markdown Reports/ReadMe Out.md")); | |
//Setting up description variable | |
const string description = "GroupDocs.Assembly for .NET is a class library that enables you to generate documents in popular " + | |
"office and email file formats based upon template documents and data obtained from various sources " + | |
"including databases, XML, JSON, OData, objects of custom .NET types, external documents, and more."; | |
DataSourceInfo dataSourceInfo1 = new DataSourceInfo("GroupDocs.Assembly for .NET(Using Stream)", "product"); | |
DataSourceInfo dataSourceInfo2 = new DataSourceInfo(description, "description"); | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(sourceStream, targetStream, new LoadSaveOptions(FileFormat.Markdown), dataSourceInfo1,dataSourceInfo2); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
//Setting up source document template (Email or Word Document) | |
const String strDocumentTemplate = "Word Templates/ReadMe.docx"; | |
//Setting up destination Markdown reports | |
const String strDocumentReport = "Markdown Reports/ReadMe Out.md"; | |
//Setting up description variable | |
const string description = "GroupDocs.Assembly for .NET is a class library that enables you to generate documents in popular " + | |
"office and email file formats based upon template documents and data obtained from various sources " + | |
"including databases, XML, JSON, OData, objects of custom .NET types, external documents, and more."; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument( | |
CommonUtilities.GetSourceDocument(strDocumentTemplate), | |
CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo("GroupDocs.Assembly for .NET", "product"), | |
new DataSourceInfo(description, "description")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET | |
try | |
{ | |
//Setting up source document template (Email or Word Document) | |
const String strDocumentTemplate = "Word Templates/CheckBoxValueSetDemo.docx"; | |
//Setting up destination for reports | |
const String strDocumentReport = "Word Reports/CheckBoxValueSetDemo Out.docx"; | |
//Assemble the document | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), | |
CommonUtilities.SetDestinationDocument(strDocumentReport), new DataSourceInfo(boolVal, "conditional_expression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment