

|
//Sets vertical position in the font properties of picture.
picture.CharacterFormat.Position = -14;
|
var listNumber = objParagraph.Range.ListFormat.ListString;
In Docio How can I get the listNumber ?
Also in Interop.word I can go the Next Paragraph by below code
objParagraph.Range.Next(1).Text;
How can I do this in Docio ?
|
//Loads an existing Text document
WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
//Gets the paragraph in the section.
WParagraph paragraph = document.LastSection.Paragraphs[0];
//Gets next sibling item of paragraph.
IEntity entity = paragraph.NextSibling;
//Iterates to next item till get the next paragraph.
while (entity != null && !(entity is WParagraph))
{
//Accesses the next body item (should be either paragraph, table or Block content control) as IEntity
entity = entity.NextSibling != null ? entity.NextSibling : null;
}
//If current paragraph contains next sibling as paragraph, then gets text from that paragraph.
string paragraphText = entity != null ? (entity as WParagraph).Text : null;
//Saves and closes the Word document.
document.Save("Sample.docx", FormatType.Docx);
document.Close(); |
Register the license key in Application_Start method of Global.asax.cs
void Application_Start(object sender, EventArgs e)
{
//Register Syncfusion license
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("My LICENSE KEY");
}
i have added the key. I am getting embed equation .why is that.
|
/// <summary> /// Gets the paragraph text by ignoring field codes. /// </summary> private string GetDisplayText(WParagraph paragraph) { string text = string.Empty; bool isFieldCode = false; foreach(Entity child in paragraph.Items) { if (child is WOleObject || child is WField) isFieldCode = true; else if (isFieldCode && child is WFieldMark && (child as WFieldMark).Type == FieldMarkType.FieldSeparator) isFieldCode = false; else if (!isFieldCode && child is WTextRange) text += (child as WTextRange).Text; } return text; } |
|
WPicture pic = oleObject.OlePicture;
Bitmap bitmap = new Bitmap((int)pic.Width + 50,(int)pic.Height + 50); |