Skip to content

Commit ed10480

Browse files
Merge pull request #2073 from syncfusion-content/ES-999797_CSS_Selector
ES-999797-Added CSS Selector subpage under Word to HTML conversion in DocIO UG
2 parents ab896eb + 1afbd5e commit ed10480

2 files changed

Lines changed: 82 additions & 6 deletions

File tree

Document-Processing/Word/Word-Library/NET/faqs/word-document-faqs.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ DocIO is a non-UI component that provides a comprehensive document object model
293293

294294
If you encounter a **Wrong signature** exception while attempting to open an XML file using DocIO, it likely indicates that the XML file is not in the supported Word Processing 2007 or 2003 format. DocIO specifically supports these XML formats. To resolve this issue, please verify that the input XML file adheres to the Word Processing 2007 or 2003 format.
295295

296-
For more information on Word Processing XML, refer to the documentation [here](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-processing-xml-xml).
297-
298296
## How to set the current culture while running the .NET application?
299297

300298
If you notice that certain content in a Word document, such as dates or other culture-sensitive fields, is displayed in the wrong language or format, it could be due to the culture settings of your application. To ensure that the application displays content according to a specific culture, you can set the current culture programmatically.
@@ -674,10 +672,8 @@ This is because a Word document is a flow-based document, where contents are not
674672

675673
DocIO is a non-UI component that provides a full-fledged document object model to manipulate the Word document contents based on file-level information. Hence, it is not feasible to retrieve the position of an element within a Word document using DocIO.
676674

677-
#Sensitivity Labels in Word Documents
678-
679-
##Does DocIO support sensitivity labels?
675+
## Does DocIO support sensitivity labels?
680676
No, Sensitivity labels are organization-level settings and are not stored within the word document itself. Therefore, DocIO does not support applying or preserving sensitivity labels.
681677

682-
##Can DocIO Open a Document with Sensitivity Labels Applied?
678+
## Can DocIO Open a Document with Sensitivity Labels Applied?
683679
If a document is encrypted due to its sensitivity label configuration, DocIO cannot open it because the content is stored in an encrypted format and requires an authorized Microsoft account for access.

Document-Processing/Word/Word-Library/NET/html.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,86 @@ N> Calling the above event is mandatory in ASP.NET Core, UWP, and Xamarin platfo
248248

249249
* [How to get image from URL while opening HTML in .NET Core targeting applications?](https://www.syncfusion.com/kb/13053/how-to-get-image-from-url-while-opening-html-in-asp-net-core)
250250

251+
### Supported CSS Selector in DocIO
252+
253+
CSS selectors are used to select the HTML elements you want to style and apply a set of CSS rules.
254+
255+
N> DocIO supports only internally defined CSS selectors during HTML conversion and does not support external CSS selectors referenced in the HTML file.
256+
257+
<table>
258+
<tr>
259+
<td><strong>Selectors</strong></td>
260+
<td><strong>CSS Code</strong></td>
261+
<td><strong>HTML</strong></td>
262+
</tr>
263+
<tr>
264+
<td>Element Selector</td>
265+
<td>p {
266+
color: yellow;
267+
font-size: 36px;
268+
}
269+
</td>
270+
<td><code>&lt;p&gt;This is Element selector Paragraph&lt;/p&gt;</code></td>
271+
</tr>
272+
<tr>
273+
<td>Class selector</td>
274+
<td>.highlight {
275+
color: red;
276+
font-size: 18pt;
277+
}
278+
</td>
279+
<td><code>&lt;p class="highlight"&gt;This is a class selector Paragraph&lt;/p&gt;</code></td>
280+
</tr>
281+
<tr>
282+
<td>ID selector</td>
283+
<td>#demo-id {
284+
color: #1a73e8;
285+
font-size: 22pt;
286+
font-weight: 600;
287+
}
288+
</td>
289+
<td><code>&lt;p id="demo-id"&gt;This is ID Selector paragraph&lt;/p&gt;</code></td>
290+
</tr>
291+
<tr>
292+
<td>Group Selectors</td>
293+
<td>h2, .group-title {
294+
color: green;
295+
font-size: 20pt;
296+
}
297+
</td>
298+
<td>
299+
<code>&lt;h2&gt;Group Selector Example&lt;/h2&gt;<br>
300+
&lt;p class="group-title"&gt;Paragraph styled by group selector.&lt;/p&gt;</code>
301+
</td>
302+
</tr>
303+
<tr>
304+
<td>Compound Selectors</td>
305+
<td>p.compound {
306+
color: orange;
307+
font-size: 26pt;
308+
font-weight: bold;
309+
}
310+
</td>
311+
<td><code>&lt;p class="compound"&gt;Paragraph for Class + Compound&lt;/p&gt;</code></td>
312+
</tr>
313+
<tr>
314+
<td>Descendant Selectors</td>
315+
<td>div p {
316+
color: #5f7000;
317+
font-style: italic;
318+
font-size: 18px;
319+
}
320+
</td>
321+
<td>
322+
<code>&lt;div&gt;<br>
323+
&nbsp;&nbsp;&lt;p&gt;Descendant Selector: Paragraph inside a div.&lt;/p&gt;<br>
324+
&lt;/div&gt;</code>
325+
</td>
326+
</tr>
327+
</table>
328+
329+
You can download a complete working sample that includes all these CSS selectors from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word)
330+
251331
## Convert Word to HTML
252332

253333
The following code example shows how to convert the Word document into HTML.

0 commit comments

Comments
 (0)