# ดูหรือแก้ไขข้อมูลเมตาของไฟล์ PPTX โดยใช้ Java

> ซอร์สโค้ด Java เพื่อแก้ไขหรือดูข้อมูลเมตาของรูปแบบ PPTX

Source: https://products.aspose.com/slides/th/java/metadata/pptx/
Updated: 2023-04-25



## แก้ไขคุณสมบัติ PPTX ผ่าน Java

เมื่อใช้ Aspose.Slides for Java นักพัฒนาสามารถเข้าถึงและแก้ไขค่าของคุณสมบัติในตัวรวมถึงคุณสมบัติที่กำหนดเอง นักพัฒนาสามารถใช้คุณสมบัติ [DocumentProperties](https://reference.aspose.com/slides/java/com.aspose.slides/documentproperties/) ที่เปิดเผยโดยออบเจกต์การนำเสนอเพื่อเข้าถึงคุณสมบัติเอกสารของไฟล์การนำเสนอ

### แก้ไข PPTX คุณสมบัติในตัว - Java

```java

Presentation pres = new Presentation("Presentation.pptx");
try {
    // Create a reference to IDocumentProperties object associated with Presentation
    IDocumentProperties dp = pres.getDocumentProperties();

    // Set the built-in properties
    dp.setAuthor("Aspose.Slides for Java");
    dp.setTitle("Modifying Presentation Properties");
    dp.setSubject("Aspose Subject");
    dp.setComments("Aspose Description");
    dp.setManager("Aspose Manager");

    // Save your presentation to a file
    pres.save("DocProps.pptx", SaveFormat.Pptx);
} finally {
    if (pres != null) pres.dispose();
}
```

### เพิ่มคุณสมบัติที่กำหนดเองใน PPTX - Java

```java

Presentation pres = new Presentation();
try {
    // Getting Document Properties
    IDocumentProperties dProps = pres.getDocumentProperties();

    // Adding Custom properties
    dProps.set_Item("New Custom", 12);
    dProps.set_Item("My Name", "Aspose Metadata Editor");
    dProps.set_Item("Custom", 124);

    // Getting property name at particular index
    String getPropertyName = dProps.getCustomPropertyName(2);

    // Removing selected property
    dProps.removeCustomProperty(getPropertyName);

    // Saving presentation
    pres.save("CustomDemo.pptx", SaveFormat.Pptx);
} finally {
    if (pres != null) pres.dispose();
}
```

## วิธีดึงข้อมูลเมตาของ PPTX ผ่าน Java

นี่คือขั้นตอนในการดึงข้อมูลเมตาจากไฟล์ PPTX

สร้างอินสแตนซ์ของคลาสงานนำเสนอด้วยพาธไปยังไฟล์ PPTX

รับวัตถุ DocumentProperties ที่เกี่ยวข้องกับการนำเสนอ

วนซ้ำรายการในวัตถุ DocumentProperties

เข้าถึงและแก้ไขคุณสมบัติแบบกำหนดเอง

## รูปแบบ Metadata อื่นๆ ที่รองรับ
