We’re pleased to announce the GroupDocs.Redaction for Java 25.12 release, available as of December 2025. This point release resolves a single issue that affected the handling of PowerPoint Template Macro‑enabled (POTM) files after redaction.

สิ่งใหม่ในเวอร์ชันนี้

รหัสปัญหา สรุป หมวดหมู่
REDACTIONJAVA-246 ไม่สามารถเปิดไฟล์ POTM หลังจากทำการลบเดือด แก้ไข

รายละเอียดการแก้ไข
เมื่อการนำเสนอถูกโหลดจากสตรีม, ทำการลบเดือด, แล้วบันทึกต่อไป, ผลลัพธ์จะถูกแปลงเป็นรูปแบบ PPTX อย่างผิดพลาดโดยไม่คำนึงถึงประเภทไฟล์ต้นฉบับ การแก้ไขทำให้ไฟล์ที่ลบเดือดยังคงรูปแบบ POTM ดั้งเดิม

ตัวอย่างโค้ด (พฤติกรรมที่แก้ไขแล้ว)

import com.groupdocs.redaction.Redactor;
import com.groupdocs.redaction.redactions.ExactPhraseRedaction;
import com.groupdocs.redaction.redactions.ReplacementOptions;
import com.groupdocs.redaction.options.RasterizationOptions;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class RedactPotm {
    public static void main(String[] args) throws Exception {
        // Define input and output file paths
        Path inputPath = Paths.get("source.potm");
        Path outputPath = Paths.get("redacted.potm");

        // Open input stream, create redactor, and prepare output stream
        // All resources are automatically closed when exiting the try block
        try (final InputStream inputStream = Files.newInputStream(inputPath);
             final Redactor redactor = new Redactor(inputStream);
             final OutputStream outputStream = Files.newOutputStream(outputPath)) {

            // Configure redaction: define text to redact and replacement string
            String textToRedact = "TEXT";
            String redactWith = "****";

            // Create replacement options and exact phrase redaction
            ReplacementOptions textReplacement = new ReplacementOptions(redactWith);
            ExactPhraseRedaction textRedaction = new ExactPhraseRedaction(textToRedact, textReplacement);

            // Apply the redaction to the document
            redactor.apply(textRedaction);

            // Configure rasterization options (disable rasterization for presentations)
            RasterizationOptions rasterizationOptions = new RasterizationOptions();
            rasterizationOptions.setEnabled(false);

            // Save the redacted presentation
            // Fixed: Now preserves the original POTM format instead of converting to PPTX
            redactor.save(outputStream, rasterizationOptions);
        }
    }
}

ตัวอย่างนี้แสดงกระบวนการทำงานที่แก้ไขแล้ว: โหลดไฟล์ POTM จากสตรีม, ใช้การลบเดือดข้อความอย่างง่าย, แล้วบันทึกผลลัพธ์กลับเป็น POTM โดยไม่แปลงรูปแบบโดยไม่ต้องการ

วิธีรับการอัปเดต

อัปเดตเวอร์ชันของ dependency ในไฟล์ pom.xml ของคุณ:

<dependencies>
   <dependency>
      <groupId>com.groupdocs</groupId>
      <artifactId>groupdocs-redaction</artifactId>
      <version>25.12</version>
   </dependency>
</dependencies>

หรือดาวน์โหลดแพ็กเกจโดยตรงจาก Maven repository ของเรา:

https://releases.groupdocs.com/java/repo/com/groupdocs/groupdocs-redaction/25.12/

แหล่งข้อมูลเพิ่มเติม

ข้อเสนอแนะ

เรายินดีรับฟังความคิดเห็นของคุณ! หากคุณมีคำถาม, พบปัญหา, หรือมีข้อเสนอแนะ, กรุณาเยี่ยมชม Free Support Forum ของเรา ทีมงานพร้อมให้ความช่วยเหลือ.