Skip to content
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

Merged
merged 6 commits into from
Sep 11, 2024

Conversation

DharanyaSakthivel-SF4210
Copy link
Collaborator

@DharanyaSakthivel-SF4210 DharanyaSakthivel-SF4210 commented Sep 3, 2024

Description:
Modified DocIO GitHub examples for Table Of Content, Table and Word-document folders.

Copy link
Contributor

@LokeshBaskar LokeshBaskar left a 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/");
Copy link
Contributor

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()

Copy link
Collaborator Author

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))
Copy link
Contributor

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.

Copy link
Collaborator Author

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))
Copy link
Contributor

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

Copy link
Collaborator Author

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);
Copy link
Contributor

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

Copy link
Collaborator Author

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);
Copy link
Contributor

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

Copy link
Collaborator Author

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))
Copy link
Contributor

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";
Copy link
Contributor

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

Copy link
Collaborator Author

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";
Copy link
Contributor

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

Copy link
Collaborator Author

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))
Copy link
Contributor

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))
Copy link
Contributor

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

@DharanyaSakthivel-SF4210 DharanyaSakthivel-SF4210 changed the title Add-playground-in-sample ES-906755 -Modify DocIO GitHub examples repository for document processing playground Sep 10, 2024
Copy link
Contributor

@LokeshBaskar LokeshBaskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No concerns

@MohanaselvamJothi MohanaselvamJothi merged commit c5955e2 into main Sep 11, 2024
1 check failed
@MohanaselvamJothi MohanaselvamJothi deleted the Add-playground-in-sample branch September 11, 2024 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants