Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed App_Data/Data/DocIO/BkmkDocumentPart_Template.doc
Binary file not shown.
Binary file not shown.
Binary file removed App_Data/Data/DocIO/Bookmark_Template.doc
Binary file not shown.
Binary file added App_Data/Data/DocIO/Bookmark_Template.docx
Binary file not shown.
Binary file added App_Data/Data/DocIO/Create Equation.docx
Binary file not shown.
Binary file modified App_Data/Data/DocIO/DoctoPDF.docx
Binary file not shown.
Binary file modified App_Data/Data/DocIO/Mathematical Equation.docx
Binary file not shown.
Binary file removed App_Data/Data/DocIO/Security Settings.doc
Binary file not shown.
Binary file added App_Data/Data/DocIO/Security Settings.docx
Binary file not shown.
Binary file added App_Data/Data/DocIO/TrackChangesTemplate.docx
Binary file not shown.
Binary file added App_Data/Presentation/EmbeddedOleObject.pptx
Binary file not shown.
Binary file added App_Data/Presentation/OleTemplate.docx
Binary file not shown.
Binary file removed App_Data/Presentation/OleTemplate.xlsx
Binary file not shown.
Binary file added App_Data/XlsIO/ExcelToJSON.xlsx
Binary file not shown.
Binary file modified App_Data/XlsIO/ExcelTopdfwithChart.xlsx
Binary file not shown.
3,075 changes: 3,075 additions & 0 deletions App_Data/XlsIO/HTMLToExcel.html

Large diffs are not rendered by default.

Binary file modified Content/Presentation/OlePicture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73,822 changes: 73,822 additions & 0 deletions Content/styles/bootstrap-dark.css

Large diffs are not rendered by default.

2,185 changes: 1,933 additions & 252 deletions Content/styles/bootstrap.css

Large diffs are not rendered by default.

2,224 changes: 1,965 additions & 259 deletions Content/styles/bootstrap4.css

Large diffs are not rendered by default.

73,681 changes: 73,681 additions & 0 deletions Content/styles/fabric-dark.css

Large diffs are not rendered by default.

2,194 changes: 1,944 additions & 250 deletions Content/styles/fabric.css

Large diffs are not rendered by default.

2,198 changes: 1,950 additions & 248 deletions Content/styles/highcontrast.css

Large diffs are not rendered by default.

82,215 changes: 82,215 additions & 0 deletions Content/styles/material-dark.css

Large diffs are not rendered by default.

2,236 changes: 1,956 additions & 280 deletions Content/styles/material.css

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions Controllers/CircularGauge/GradientColorController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Syncfusion.EJ2.CircularGauge;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace EJ2MVCSampleBrowser.Controllers.CircularGauge
{
public partial class CircularGaugeController : Controller
{
// GET: Campass
public ActionResult GradientColor()
{

// Pointers //
List<CircularGaugePointer> pointers = new List<CircularGaugePointer>();
CircularGaugePointer pointer1 = new CircularGaugePointer();
pointer1.Value = 65;
pointer1.Radius = "85%";
pointer1.Color = "#E63B86";
pointer1.PointerWidth = 12;
pointer1.NeedleStartWidth = 2;
pointer1.Cap = new CircularGaugeCap { Radius= 12, Border = new CircularGaugeBorder { Width = 2.5, Color= "#E63B86" }, Color= "white" };
pointer1.NeedleStartWidth = 2;
pointer1.NeedleTail = new CircularGaugeNeedleTail { Length = "0%" };
pointer1.Animation = new CircularGaugeAnimation{ Enable = false };
pointers.Add(pointer1);
ViewBag.Pointers = pointers;

// Ranges //
List<CircularGaugeRange> ranges = new List<CircularGaugeRange>();
CircularGaugeRange range1 = new CircularGaugeRange();
range1.Start = 0;
range1.End = 120 ;
range1.StartWidth = "18";
range1.EndWidth = "18";
range1.Color = "#E63B86";
range1.RoundedCornerRadius = 10;
ranges.Add(range1);
ViewBag.Ranges = ranges;
return View();
}
}
}
36 changes: 29 additions & 7 deletions Controllers/DocIO/BookmarkNavigationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ namespace EJ2MVCSampleBrowser.Controllers.DocIO
{
public partial class DocIOController : Controller
{
public ActionResult BookmarkNavigation(string Group1)
public ActionResult BookmarkNavigation(string Group1,string Button)
{
if (Group1 == null)
return View();
if (Button == null)
return View();

if (Button == "View Template")
return new TemplateResult("Bookmark_Template.docx", ResolveApplicationDataPath("Data\\DocIO"), HttpContext.ApplicationInstance.Response);
#region BookmarkNavigation
// Creating a new document.
WordDocument document = new WordDocument();
Expand All @@ -41,9 +46,9 @@ public ActionResult BookmarkNavigation(string Group1)
document.LastParagraph.AppendText("Northwind database with normalization concept");
document.LastParagraph.AppendBookmarkEnd("NorthwindDatabase");
// Open an existing template document with single section to get Northwind.information
WordDocument nwdInformation = new WordDocument(ResolveApplicationDataPath("Bookmark_Template.doc", "Data\\DocIO"));
WordDocument nwdInformation = new WordDocument(ResolveApplicationDataPath("Bookmark_Template.docx", "Data\\DocIO"));
// Open an existing template document with multiple section to get Northwind data.
WordDocument templateDocument = new WordDocument(ResolveApplicationDataPath("BkmkDocumentPart_Template.doc", "Data\\DocIO"));
WordDocument templateDocument = new WordDocument(ResolveApplicationDataPath("BkmkDocumentPart_Template.docx", "Data\\DocIO"));
// Creating a bookmark navigator. Which help us to navigate through the
// bookmarks in the template document.
BookmarksNavigator bk = new BookmarksNavigator(templateDocument);
Expand All @@ -69,6 +74,23 @@ public ActionResult BookmarkNavigation(string Group1)
bk.MoveToBookmark("Northwind_Information");
// Replacing content of Northwind_Information bookmark.
bk.ReplaceBookmarkContent(bodyPart);
#region Bookmark selection for table
// Creating a bookmark navigator. Which help us to navigate through the
// bookmarks in the Northwind information document.
bk = new BookmarksNavigator(nwdInformation);
bk.MoveToBookmark("SuppliersTable");
//Sets the column index where the bookmark starts within the table
// bk.CurrentBookmark.FirstColumn = 1;
//Sets the column index where the bookmark ends within the table
//bk.CurrentBookmark.LastColumn = 5;
//// Get the content of suppliers table bookmark.
bodyPart = bk.GetBookmarkContent();
// Creating a bookmark navigator. Which help us to navigate through the
// bookmarks in the destination document.
bk = new BookmarksNavigator(document);
bk.MoveToBookmark("Table");
bk.ReplaceBookmarkContent(bodyPart);
#endregion
// Move to the text bookmark
bk.MoveToBookmark("Text");
//Deletes the bookmark content
Expand Down Expand Up @@ -179,25 +201,25 @@ public ActionResult BookmarkNavigation(string Group1)
//Save as .doc format
if (Group1 == "WordDoc")
{
return document.ExportAsActionResult("Sample.doc", FormatType.Doc, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Bookmark Navigation.doc", FormatType.Doc, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .docx format
else if (Group1 == "WordDocx")
{
return document.ExportAsActionResult("Sample.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Bookmark Navigation.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
// Save as WordML(.xml) format
else if (Group1 == "WordML")
{
return document.ExportAsActionResult("Sample.xml", FormatType.WordML, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Bookmark Navigation.xml", FormatType.WordML, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .pdf format
else if (Group1 == "Pdf")
{
DocToPDFConverter converter = new DocToPDFConverter();
PdfDocument pdfDoc = converter.ConvertToPDF(document);

return pdfDoc.ExportAsActionResult("sample.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
return pdfDoc.ExportAsActionResult("Bookmark Navigation.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
}
#endregion Document SaveOption
return View();
Expand Down
27 changes: 21 additions & 6 deletions Controllers/DocIO/CreateEquationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ namespace EJ2MVCSampleBrowser.Controllers.DocIO

public partial class DocIOController : Controller
{
public ActionResult CreateEquation(string Button)
public ActionResult CreateEquation(string Button, string Group1)
{
if (Button == null)
return View();

//Creates a new word document instance
WordDocument document = new WordDocument();
//Adds new section to the document
IWSection section = document.AddSection();
//Opens an existing Word document
WordDocument document = new WordDocument(ResolveApplicationDataPath("Create Equation.docx", "Data\\DocIO"));
//Gets the last section in the document
WSection section = document.LastSection;
//Sets page margins
document.LastSection.PageSetup.Margins.All = 72;
//Adds new paragraph to the section
Expand Down Expand Up @@ -82,7 +82,22 @@ public ActionResult CreateEquation(string Button)
CreateVectorRelation(paragraph);
#endregion

return document.ExportAsActionResult("Sample.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
//Save as .docx format
if (Group1== "WordDocx")
{
return document.ExportAsActionResult("CreateEquation.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .pdf format
else if (Group1 == "Pdf")
{
DocToPDFConverter converter = new DocToPDFConverter();
PdfDocument pdfDoc = converter.ConvertToPDF(document);
document.Close();
converter.Dispose();
return pdfDoc.ExportAsActionResult("CreateEquation.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
}

return View();
}
#region Helper Methods
/// <summary>
Expand Down
27 changes: 23 additions & 4 deletions Controllers/DocIO/EditEquationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using System.Web.Mvc.Ajax;
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;
using Syncfusion.Pdf;
using Syncfusion.Mvc.Pdf;
using Syncfusion.Office;

Expand All @@ -25,12 +27,14 @@ namespace EJ2MVCSampleBrowser.Controllers.DocIO

public partial class DocIOController : Controller
{
public ActionResult EditEquation(string Button)
public ActionResult EditEquation(string Button, string Group1)
{
if (Button == null)
return View();

//Opens an existing Word document
if (Button == "View Template")
return new TemplateResult("Mathematical Equation.docx", ResolveApplicationDataPath("Data\\DocIO"), HttpContext.ApplicationInstance.Response);

//Opens an existing Word document
WordDocument document = new WordDocument(ResolveApplicationDataPath("Mathematical Equation.docx", "Data\\DocIO"));
//Gets the last section in the document
WSection section = document.LastSection;
Expand Down Expand Up @@ -85,7 +89,22 @@ public ActionResult EditEquation(string Button)
//Gets the math text
(mathParaItem.Item as WTextRange).Text = "x";

return document.ExportAsActionResult("Sample.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
//Save as .docx format
if (Group1== "WordDocx")
{
return document.ExportAsActionResult("EditEquation.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .pdf format
else if (Group1 == "Pdf")
{
DocToPDFConverter converter = new DocToPDFConverter();
PdfDocument pdfDoc = converter.ConvertToPDF(document);
document.Close();
converter.Dispose();
return pdfDoc.ExportAsActionResult("EditEquation.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
}

return View();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Controllers/DocIO/EncryptandDecryptController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ActionResult EncryptandDecrypt(string Group1, string Group2)
{
document = new WordDocument();
// Open an existing template document.
document.Open(ResolveApplicationDataPath("Security Settings.doc", "Data\\DocIO"), FormatType.Doc, "syncfusion");
document.Open(ResolveApplicationDataPath("Security Settings.docx", "Data\\DocIO"), FormatType.Doc, "syncfusion");

// Getting last section of the document.
IWSection section = document.LastSection;
Expand Down
39 changes: 30 additions & 9 deletions Controllers/DocIO/ImageInsertionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public ActionResult ImageInsertion(string Group1)

//Adding a new section to the document.
IWSection section = document.AddSection();
section.PageSetup.Margins.All = 72;

//Adding a paragraph to the section
IWParagraph paragraph = section.AddParagraph();
Expand All @@ -50,28 +51,32 @@ public ActionResult ImageInsertion(string Group1)
//Inserting .gif .
WPicture picture = (WPicture)paragraph.AppendPicture(Image.FromFile(System.IO.Path.Combine(dataPath2, "yahoo.gif")));
//Adding Image caption
picture.AddCaption("Yahoo [.gif Image]", CaptionNumberingFormat.Roman, CaptionPosition.AboveImage);
picture.AddCaption("Figure", CaptionNumberingFormat.Roman, CaptionPosition.AfterImage);
ApplyFormattingForCaption(document.LastParagraph);

paragraph = section.AddParagraph();
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
//Inserting .bmp
picture = (WPicture)paragraph.AppendPicture(Image.FromFile(dataPath2 + "Reports.bmp"));
//Adding Image caption
picture.AddCaption("Reports [.bmp Image]", CaptionNumberingFormat.Roman, CaptionPosition.AboveImage);
picture.AddCaption("Figure", CaptionNumberingFormat.Roman, CaptionPosition.AfterImage);
ApplyFormattingForCaption(document.LastParagraph);

paragraph = section.AddParagraph();
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
//Inserting .png
picture = (WPicture)paragraph.AppendPicture(Image.FromFile(dataPath2 + "google.PNG"));
//Adding Image caption
picture.AddCaption("Google [.png Image]", CaptionNumberingFormat.Roman, CaptionPosition.AboveImage);
picture.AddCaption("Figure", CaptionNumberingFormat.Roman, CaptionPosition.AfterImage);
ApplyFormattingForCaption(document.LastParagraph);

paragraph = section.AddParagraph();
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
//Inserting .tif
picture = (WPicture)paragraph.AppendPicture(Image.FromFile(dataPath2 + "Square.tif"));
//Adding Image caption
picture.AddCaption("Square [.tif Image]", CaptionNumberingFormat.Roman, CaptionPosition.AboveImage);
picture.AddCaption("Figure", CaptionNumberingFormat.Roman, CaptionPosition.AfterImage);
ApplyFormattingForCaption(document.LastParagraph);

//Adding a new paragraph.
paragraph = section.AddParagraph();
Expand All @@ -84,33 +89,49 @@ public ActionResult ImageInsertion(string Group1)
mImage.WidthScale = 50f;

//Adding Image caption
mImage.AddCaption("Chart Vector Image", CaptionNumberingFormat.Roman, CaptionPosition.AboveImage);
mImage.AddCaption("Figure", CaptionNumberingFormat.Roman, CaptionPosition.AfterImage);
ApplyFormattingForCaption(document.LastParagraph);

//Updates the fields in Word document
document.UpdateDocumentFields();

//Save as .doc format
if (Group1 == "WordDoc")
{
return document.ExportAsActionResult("Sample.doc", FormatType.Doc, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Image Insertion.doc", FormatType.Doc, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .docx format
else if (Group1 == "WordDocx")
{
return document.ExportAsActionResult("Sample.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Image Insertion.docx", FormatType.Docx, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
// Save as WordML(.xml) format
else if (Group1 == "WordML")
{
return document.ExportAsActionResult("Sample.xml", FormatType.WordML, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
return document.ExportAsActionResult("Image Insertion.xml", FormatType.WordML, HttpContext.ApplicationInstance.Response, HttpContentDisposition.Attachment);
}
//Save as .pdf format
else if (Group1 == "Pdf")
{
DocToPDFConverter converter = new DocToPDFConverter();
PdfDocument pdfDoc = converter.ConvertToPDF(document);

return pdfDoc.ExportAsActionResult("sample.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
return pdfDoc.ExportAsActionResult("Image Insertion.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
}
return View();
}
/// <summary>
/// Apply formattings for image caption paragraph
/// </summary>
private void ApplyFormattingForCaption(WParagraph paragraph)
{
//Align the caption
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
//Sets after spacing
paragraph.ParagraphFormat.AfterSpacing = 1.5f;
//Sets before spacing
paragraph.ParagraphFormat.BeforeSpacing = 1.5f;
}
#endregion ImageInsertion
}
}
Loading