This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tika import parser | |
| file_path = "example.pdf" | |
| # Parse the file | |
| parsed = parser.from_file('media_file.mp4') | |
| # Extract metadata | |
| print(parsed["metadata"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from hachoir.parser import createParser | |
| from hachoir.metadata import extractMetadata | |
| # File to extract metadata from | |
| file_path = "media_file.mp4" | |
| # Create a parser for the file | |
| parser = createParser(file_path) | |
| if not parser: | |
| print("Unable to parse file.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import exiftool | |
| files = ["2407.10671v3.pdf"] | |
| with exiftool.ExifToolHelper() as et: | |
| metadata = et.get_metadata(files) | |
| for d in metadata: | |
| for k, v in d.items(): | |
| print(f"Dict: {k} = {v}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Presentation presentation = Presentation.Create("InsertImageInSlide.pptx"); | |
| // Create slide | |
| Slide slide = new Slide(); | |
| // Add text shapes. | |
| Image image1 = new Image("image.png"); | |
| // Set xAxis | |
| image1.X = 180.0; | |
| // Set yAxis | |
| image1.Y = 128.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a new PowerPoint presentation at the specified file path | |
| Presentation presentation = Presentation.Create("PowerPointPreesentation.pptx"); | |
| // Create a text shape for the title and set its properties | |
| TextShape shape = new TextShape(); | |
| shape.Text = "Title: First Title From Fileformat.Dev"; | |
| shape.TextColor = "980078"; | |
| shape.FontFamily = "Arial"; | |
| // Create the slide and add the text shape to it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create an object of the Presentation class. | |
| Presentation presentation = Presentation.Create("blankPresentation.pptx"); | |
| //Perform necessary operations. | |
| //... | |
| // Call the Save method to save the PowerPoint file onto the disk. | |
| presentation.Save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Workbook workbook = new Workbook(); | |
| workbook.ApplyFontStyle("Arial", 14); | |
| Worksheet worksheet = new Worksheet(workbook); | |
| worksheet.insertValue("A10", 10, "some data", 0); | |
| worksheet.saveDataToSheet(0); | |
| workbook.Save("spreadsheet.xlsx"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create an object of the Workbook class. | |
| Workbook workbook = new Workbook(); | |
| // Call the Save method to save the Excel file onto the disk. | |
| workbook.Save("/spreadsheet.xlsx"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fileInfo = new FileInfo("d:\\testfile.eml"); | |
| var eml = MsgReader.Mime.Message.Load(fileInfo); | |
| if (eml.Headers != null) | |
| { | |
| if (eml.Headers.To != null) | |
| { | |
| foreach (var recipient in eml.Headers.To) | |
| { | |
| var to = recipient.Address; |