Skip to content

Commit c138643

Browse files
authored
Merge pull request #28 from aspose-words/staging
Staging
2 parents 6bfdffd + ef33af1 commit c138643

File tree

49 files changed

+214
-2466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+214
-2466
lines changed

content/english/python-net/_index.md

-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ Master word document processing using Aspose.Words for Python. Tutorials offer p
2626
Master document creation with Aspose.Words for Python. Create dynamic documents, customize formatting, and streamline word document processing.
2727
### [Word Automation](./word-automation/)
2828
Automate word processing tasks with Aspose.Words for Python. Streamline document management and boost efficiency in word automation.
29-
### [Document Intelligence](./document-intelligence/)
30-
Unlock valuable insights from your documents with Aspose.Words for Python's Document Intelligence. Automate analysis, text extraction, and classification.
3129
### [Document Conversion](./document-conversion/)
3230
Efficiently convert documents between formats with Aspose.Words for Python. Streamline word document processing and simplify your document management tasks.
33-
### [Document Protection](./document-protection/)
34-
Secure your documents with Aspose.Words for Python! Implement password encryption, user permissions, and digital signatures for robust document protection.
3531
### [Document Structure and Content Manipulation](./document-structure-and-content-manipulation/)
3632
Explore Aspose.Words tutorials for Python and .NET, focusing on document structure and content manipulation. Learn how to navigate, extract, and modify document elements efficiently. Source code examples provided.
3733
### [Content Extraction and Manipulation](./content-extraction-and-manipulation/)
@@ -42,7 +38,5 @@ Discover comprehensive tutorials on document combining and comparison using Aspo
4238
Explore the Aspose.Words tutorials on document splitting and formatting in Python and .NET. Learn to split and format documents efficiently, enhancing your document processing tasks.
4339
### [Document Options and Settings](./document-options-and-settings/)
4440
Explore Aspose.Words tutorials on document options and settings in Python and .NET. Learn to optimize document creation and formatting using step-by-step guidance and source code examples.
45-
### [Data Visualization and Formatting](./data-visualization-and-formatting/)
46-
Discover Aspose.Words tutorials on data visualization and formatting in Python and .NET. Learn to present data effectively, create stunning reports, and format documents programmatically.
4741
### [Tables and Formatting](./tables-and-formatting/)
4842
Dive into Aspose.Words tutorials on tables and formatting in Python and .NET applications. Learn to create, customize, and style tables for visually compelling documents.

content/english/python-net/content-extraction-and-manipulation/document-content-extraction/_index.md

-12
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ for paragraph in doc.get_child_nodes(doc.is_paragraph, True):
4444
text += paragraph.get_text()
4545
```
4646

47-
## Extracting Images
48-
49-
To extract images from the document:
50-
51-
```python
52-
for shape in doc.get_child_nodes(doc.is_shape, True):
53-
if shape.has_image:
54-
image = shape.image_data.to_bytes()
55-
with open("image.png", "wb") as f:
56-
f.write(image)
57-
```
58-
5947
## Managing Formatting
6048

6149
Preserving formatting during extraction:

content/english/python-net/content-extraction-and-manipulation/extract-modify-document-content/_index.md

-10
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ for para in doc.get_child_nodes(asposewords.NodeType.PARAGRAPH, True):
4040
print(text)
4141
```
4242

43-
## Modifying Text
44-
45-
You can modify text by directly setting the text of runs or paragraphs:
46-
47-
```python
48-
for para in doc.get_child_nodes(asposewords.NodeType.PARAGRAPH, True):
49-
if "old_text" in para.get_text():
50-
para.get_runs().get(0).set_text("new_text")
51-
```
52-
5343
## Working with Formatting
5444

5545
Aspose.Words allows you to work with formatting styles:

content/english/python-net/content-extraction-and-manipulation/remove-content-documents/_index.md

-29
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ for paragraph in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True):
5151
paragraph.get_range().replace(text_to_remove, replacement, False, False)
5252
```
5353

54-
## Replacing Text
55-
56-
Sometimes, you might want to replace certain text with new content. Here's an example of how to do it:
57-
58-
```python
59-
text_to_replace = "old text"
60-
new_text = "new text"
61-
62-
for paragraph in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True):
63-
if text_to_replace in paragraph.get_text():
64-
paragraph.get_range().replace(text_to_replace, new_text, False, False)
65-
```
66-
6754
## Removing Images
6855

6956
If you need to remove images from the document, you can use a similar approach. First, identify the images and then remove them:
@@ -94,22 +81,6 @@ for section in doc.sections:
9481
doc.remove_child(section)
9582
```
9683

97-
## Find and Replace with Regex
98-
99-
Regular expressions offer a powerful way to find and replace content:
100-
101-
```python
102-
import re
103-
104-
pattern = r"\b\d{4}\b" # Example: Replace four-digit numbers
105-
replacement = "****"
106-
107-
for paragraph in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True):
108-
text = paragraph.get_text()
109-
new_text = re.sub(pattern, replacement, text)
110-
paragraph.get_range().text = new_text
111-
```
112-
11384
## Extracting Specific Content
11485

11586
Sometimes, you might need to extract specific content from a document:

content/english/python-net/data-visualization-and-formatting/_index.md

-42
This file was deleted.

content/english/python-net/data-visualization-and-formatting/document-images/_index.md

-164
This file was deleted.

0 commit comments

Comments
 (0)