-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES-906755 -Modify DocIO GitHub examples repository for document processing playground #220
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the below feedback
@@ -3,7 +3,7 @@ | |||
using Syncfusion.DocIORenderer; | |||
|
|||
//Get the Source document names from the folder. | |||
string[] sourceDocumentNames = Directory.GetFiles(@"../../../Data/"); | |||
string[] sourceDocumentNames = Directory.GetFiles(@"Data/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@@ -34,7 +34,7 @@ | |||
//Updates the table of contents | |||
destinationDocument.UpdateTableOfContents(); | |||
//Save the destination document. | |||
using (FileStream outputStream = new FileStream(@"../../../Output.docx", FileMode.Create, FileAccess.Write)) | |||
using (FileStream outputStream = new FileStream(@"Output/Output.docx", FileMode.Create, FileAccess.Write)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check and use the Path.GetFullPath() in all places while opening and saving a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
{ | ||
//Opens an document from file system through constructor of WordDocument class. | ||
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Automatic)) | ||
{ | ||
//Sets the background type as picture. | ||
document.Background.Type = BackgroundType.Picture; | ||
//Opens the existing image. | ||
using (FileStream imageStream = new FileStream(@"../../../Data/Picture.png", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) | ||
using (FileStream imageStream = new FileStream(@"Data/Picture.png", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
@@ -18,7 +18,7 @@ | |||
ExtractExcelContent(table); | |||
|
|||
//Load the file into stream | |||
FileStream outputStream = new FileStream("../../../Data/Output.docx", FileMode.Create, FileAccess.Write); | |||
FileStream outputStream = new FileStream("Output/Output.docx", FileMode.Create, FileAccess.Write); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@@ -35,7 +35,7 @@ void ExtractExcelContent(WTable table) | |||
IApplication application = excelEngine.Excel; | |||
application.DefaultVersion = ExcelVersion.Xlsx; | |||
//Load the file into stream | |||
FileStream inputExcelStream = new FileStream("../../../Data/Sample.xlsx", FileMode.Open, FileAccess.Read); | |||
FileStream inputExcelStream = new FileStream("Data/Sample.xlsx", FileMode.Open, FileAccess.Read); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@@ -8,7 +8,7 @@ class Program | |||
{ | |||
static void Main(string[] args) | |||
{ | |||
using (FileStream inputStream = new FileStream(@"../../../Data/Template.docx", FileMode.Open, FileAccess.Read)) | |||
using (FileStream inputStream = new FileStream(@"Data/Template.docx", FileMode.Open, FileAccess.Read)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
@@ -57,7 +57,7 @@ static void Main(string[] args) | |||
if (newDocument != null) | |||
{ | |||
//Saves the Word document | |||
string fileName = @"../../../Document" + (headingIndex + 1) + ".docx"; | |||
string fileName = @"Output/Document" + (headingIndex + 1) + ".docx"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
@@ -37,7 +37,7 @@ static void Main(string[] args) | |||
if (newDocument != null) | |||
{ | |||
//Saves the Word document | |||
string fileName = @"../../../Document" + (headingIndex + 1) + ".docx"; | |||
string fileName = @"Output/Document" + (headingIndex + 1) + ".docx"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
@@ -8,7 +8,7 @@ class Program | |||
{ | |||
static void Main(string[] args) | |||
{ | |||
using (FileStream inputStream = new FileStream(@"../../../Data/Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) | |||
using (FileStream inputStream = new FileStream(@"Data/Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
@@ -23,7 +23,7 @@ static void Main(string[] args) | |||
//Add cloned section into new Word document | |||
newDocument.Sections.Add(section.Clone()); | |||
//Saves the Word document to MemoryStream | |||
using (FileStream outputStream = new FileStream(@"../../../Section" + fileId + ".docx", FileMode.OpenOrCreate, FileAccess.ReadWrite)) | |||
using (FileStream outputStream = new FileStream(@"Output/Section" + fileId + ".docx", FileMode.OpenOrCreate, FileAccess.ReadWrite)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the Path.GetFullPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No concerns
Description:
Modified DocIO GitHub examples for Table Of Content, Table and Word-document folders.