Skip to content

Commit 80bdb0c

Browse files
added 11 pages
1 parent 18be57e commit 80bdb0c

11 files changed

Lines changed: 857 additions & 0 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
id: saving-files
3+
url: metadata/python-net/saving-files
4+
title: Saving files
5+
weight: 11
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
GroupDocs.Metadata provides different ways to save a file with updated metadata.
12+
13+
Please refer to the following guides to know more about all overloads of the Save method:
14+
15+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: save-a-modified-file-to-a-specified-location
3+
url: metadata/python-net/save-a-modified-file-to-a-specified-location
4+
title: Save a modified file to a specified location
5+
weight: 2
6+
description: "This article shows how to save a document to a specified location on a local disk using GroupDocs.Metadata for Python via .NET."
7+
keywords: save a document to a specified location
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
This example shows how to save a document to a specified location on a local disk.
12+
13+
**advanced_usage.saving_files.save_file_to_specified_location**
14+
15+
16+
```python
17+
def run():
18+
# constants.input_jpeg is an absolute or relative path to your document. Ex: r"C:\\Docs\\test.jpg"
19+
with gm.Metadata(constants.input_jpeg) as metadata:
20+
# Edit or remove metadata here
21+
# ...
22+
23+
metadata.save(constants.output_jpeg)
24+
```
25+
26+
27+
## More resources
28+
### GitHub examples
29+
You may easily run the code above and see the feature in action in our GitHub examples:
30+
* [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET)
31+
* [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java)
32+
* [GroupDocs.Metadata for Python via .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Python-via-.NET/)
33+
34+
### Free online document metadata management App
35+
Along with full featured Python via .NET library we provide simple, but powerful free Apps.
36+
You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online [Free Online Document Metadata Viewing and Editing App](https://products.groupdocs.app/metadata).
37+
38+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: save-a-modified-file-to-a-stream
3+
url: metadata/python-net/save-a-modified-file-to-a-stream
4+
title: Save a modified file to a stream
5+
weight: 3
6+
description: "This article shows how to save a file to the specified stream using GroupDocs.Metadata for Python via .NET."
7+
keywords: save a file to the specified stream
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
This example shows how to save a file to the specified stream.
12+
13+
**advanced_usage.saving_files.save_file_to_specified_stream**
14+
15+
16+
```python
17+
def run():
18+
stream = io.BytesIO()
19+
# constants.input_png is an absolute or relative path to your document. Ex: r"C:\\Docs\\test.png"
20+
with gm.Metadata(constants.input_png) as metadata:
21+
# Edit or remove metadata here
22+
# ...
23+
24+
metadata.save(stream)
25+
```
26+
27+
28+
## More resources
29+
### GitHub examples
30+
You may easily run the code above and see the feature in action in our GitHub examples:
31+
* [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET)
32+
* [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java)
33+
* [GroupDocs.Metadata for Python via .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Python-via-.NET/)
34+
35+
### Free online document metadata management App
36+
Along with full featured Python via .NET library we provide simple, but powerful free Apps.
37+
You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online [Free Online Document Metadata Viewing and Editing App](https://products.groupdocs.app/metadata).
38+
39+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: save-a-modified-file-to-the-original-source
3+
url: metadata/python-net/save-a-modified-file-to-the-original-source
4+
title: Save a modified file to the original source
5+
weight: 1
6+
description: "This article shows how to save the modified content to the underlying source using GroupDocs.Metadata for Python via .NET."
7+
keywords: how to save the modified content to the underlying source
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
This example shows how to save the modified content to the underlying source.
12+
13+
**advanced_usage.saving_files.save_file_to_original_source**
14+
15+
16+
```python
17+
def run():
18+
# constants.output_ppt is an absolute or relative path to your document. Ex: r"C:\\Docs\\test.ppt"
19+
with gm.Metadata(constants.output_ppt) as metadata:
20+
# Edit or remove metadata here
21+
# ...
22+
23+
# Saves the document to the underlying source (stream or file)
24+
metadata.save()
25+
```
26+
27+
28+
## More resources
29+
### GitHub examples
30+
You may easily run the code above and see the feature in action in our GitHub examples:
31+
* [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET)
32+
* [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java)
33+
* [GroupDocs.Metadata for Python via .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Python-via-.NET/)
34+
35+
### Free online document metadata management App
36+
Along with full featured Python via .NET library we provide simple, but powerful free Apps.
37+
You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online [Free Online Document Metadata Viewing and Editing App](https://products.groupdocs.app/metadata).
38+
39+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: working-with-metadata-properties
3+
url: metadata/python-net/working-with-metadata-properties
4+
title: Working with metadata properties
5+
weight: 8
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
12+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: exporting-metadata-properties
3+
url: metadata/python-net/exporting-metadata-properties
4+
title: Exporting metadata properties
5+
weight: 1
6+
description: "Export metadata properties to an Excel workbook using GroupDocs.Metadata for Python via .NET."
7+
keywords: export metadata properties, export metadata properties to an Excel workbook
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
This example demonstrates how to export metadata properties to an Excel workbook. For more information please refer to the `ExportManager` class.
12+
13+
**advanced_usage.exporting_metadata_properties**
14+
15+
16+
```python
17+
def run():
18+
with gm.Metadata(r"D:\\input.doc") as metadata:
19+
root = metadata.get_root_package()
20+
if root is not None:
21+
# Initialize the export manager with the root metadata package to export the whole metadata tree
22+
manager = gm.export.ExportManager(root)
23+
manager.export(r"D:\\export.xls", gm.export.ExportFormat.XLS)
24+
```
25+
26+
27+
## More resources
28+
### GitHub examples
29+
You may easily run the code above and see the feature in action in our GitHub examples:
30+
* [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET)
31+
* [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java)
32+
* [GroupDocs.Metadata for Python via .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Python-via-.NET/)
33+
34+
### Free online document metadata management App
35+
Along with full featured Python via .NET library we provide simple, but powerful free Apps.
36+
You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online [Free Online Document Metadata Viewing and Editing App](https://products.groupdocs.app/metadata).
37+
38+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: extracting-property-values
3+
url: metadata/python-net/extracting-property-values
4+
title: Extracting property values
5+
weight: 2
6+
description: "Learn common ways to read metadata property values and handle types in GroupDocs.Metadata for Python via .NET."
7+
keywords: extract property values, read metadata values
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
The most common way to get the metadata property value is to check its type and convert or read it accordingly to a platform-specific type.
12+
13+
**advanced_usage.extracting_property_values.extract_using_type**
14+
15+
16+
```python
17+
def run():
18+
with gm.Metadata(constants.input_docx) as metadata:
19+
# Fetch all metadata properties from the file
20+
properties = metadata.find_properties(lambda p: True)
21+
for prop in properties:
22+
# Process string and datetime properties only (as an example)
23+
if prop.value.type == gm.common.MetadataPropertyType.STRING:
24+
print(prop.value.to_class(str))
25+
elif prop.value.type == gm.common.MetadataPropertyType.DATE_TIME:
26+
# Provide a default if conversion fails
27+
print(prop.value.to_struct(datetime.min))
28+
```
29+
30+
31+
If it's necessary to process many supported types generically, you can inspect `prop.value.raw_value` and `prop.value.type` and branch accordingly. This lets you handle arrays, numbers, booleans, nested packages, etc., in a single pass.
32+
33+
## More resources
34+
### GitHub examples
35+
You may easily run the code above and see the feature in action in our GitHub examples:
36+
* [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET)
37+
* [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java)
38+
* [GroupDocs.Metadata for Python via .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Python-via-.NET/)
39+
40+
### Free online document metadata management App
41+
Along with full featured Python via .NET library we provide simple, but powerful free Apps.
42+
You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online [Free Online Document Metadata Viewing and Editing App](https://products.groupdocs.app/metadata).
43+
44+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: working-with-metadata-standards
3+
url: metadata/python-net/working-with-metadata-standards
4+
title: Working with metadata standards
5+
weight: 9
6+
description: ""
7+
keywords:
8+
productName: GroupDocs.Metadata for Python via .NET
9+
hideChildren: False
10+
---
11+
12+

0 commit comments

Comments
 (0)