Text

อัพพีไอข้อความ

Aspose.PDF FOSS for Java provides text handling through multiple APIs depending on the use case.

FormattedText

FormattedText เป็นตัวแทนของข้อความที่ใช้ในแบบสแตมป์และคําอธิบาย รวมรหัสข้อความ พร้อมกับลักษณะตัวอักษร ขนาด และสี.

การเปลี่ยนข้อความ

PdfContentEditor.replaceText() แทนรหัสข้อความภายในสตรีมเนื้อหา PDF:

try (PdfContentEditor editor = new PdfContentEditor()) {
    editor.bindPdf("input.pdf");
    editor.replaceText("old text", "new text");
    editor.save("output.pdf");
}

TextReplaceOptions ให้การควบคุมเพิ่มเติมเกี่ยวกับวิธีที่ข้อความตรงกันและ การเปลี่ยนตัวนั้นจะเกิดขึ้น.

การสกัดข้อความ

PdfExtractor ให้ API การสกัดข้อความจากหน้าต่อหน้า หลังจากการเรียก extractText(), อีเทอเรทกับ hasNextPageText() / getNextPageText().

ดูที่ Facades หน้าสําหรับการครบ PdfExtractor ตัวอย่างหนึ่ง.

See Also

 ภาษาไทย