PDF เอกสารหมายเหตุโซลูชั่น

ลบความคิดเห็นออกจากเอกสาร PDF ด้วยแอปและ API ข้ามแพลตฟอร์มฟรี

วิธีการใส่คำอธิบายประกอบไฟล์ PDF โดยใช้ห้องสมุด Aspose.PDF

เพื่อที่จะใส่คำอธิบายประกอบไฟล์ PDF เราจะใช้ Aspose.PDF API ซึ่งเป็นคุณลักษณะที่อุดมไปด้วยที่มีประสิทธิภาพและใช้งานง่ายต่อการใช้การจัดการเอกสาร APIเปิดตัวจัดการแพคเกจ NuGet ค้นหา Aspose.PDF และติดตั้งนอกจากนี้คุณยังอาจใช้คำสั่งต่อไปนี้จากคอนโซลการจัดการแพคเกจ

API รหัสสูงเพื่อแก้ไขข้อคิดเห็นและบันทึกย่อในเอกสาร

API พื้นเมืองคำอธิบายประกอบไฟล์ PDF โดยใช้ .NET, .NET หลัก Java, C++ และ Android เหล่านี้เป็นวัตถุเพิ่มเติมที่คุณเพิ่มลงในไฟล์ของคุณเพื่อขยายเนื้อหาของข้อความทำการแก้ไขข้อคิดเห็นสำหรับผู้ใช้รายอื่นนอกจากนี้ยังสามารถทำให้ข้อความในเอกสารสามารถอ่านได้มากขึ้นเน้นขีดเส้นใต้หรือเพิ่มข้อความใหม่ทั้งหมด

<% annotation0.feature-page02.h2 %>

<% annotation0.feature-page02.text01 %>

เพิ่มคำอธิบาย Caret - C#

// Load the PDF file
Document document = new Document(System.IO.Path.Combine(_dataDir, "sample.pdf"));
// This annotation is used to indicate the insertion of text
var caretAnnotation1 = new CaretAnnotation(document.Pages[1],
    new Rectangle(299.988, 713.664, 308.708, 720.769))
{
    Title = "Aspose User",
    Subject = "Inserted text 1",
    Flags = AnnotationFlags.Print,
    Color = Color.Blue
};
document.Pages[1].Annotations.Add(caretAnnotation1);
document.Save(System.IO.Path.Combine(_dataDir, "sample_caret.pdf"));

<% annotation0.feature-page03.h2 %>

<% annotation0.feature-page03.text01 %>

เพิ่มคำอธิบายประกอบวงกลม - Java

// Load the PDF file
Document document = new com.aspose.pdf.Document(_dataDir + "appartments.pdf");
Page page = document.getPages().get_Item(1);

// Create Polygon Annotation
CircleAnnotation circleAnnotation = new CircleAnnotation(page, new Rectangle(270, 160, 483, 383));
circleAnnotation.setTitle("John Smith");
circleAnnotation.setColor(Color.getRed());
circleAnnotation.setInteriorColor(Color.getMistyRose());
circleAnnotation.setOpacity(0.5);
circleAnnotation.setPopup(new PopupAnnotation(page, new Rectangle(842, 316, 1021, 459)));

// Add annotation to the page
page.getAnnotations().add(circleAnnotation);
document.save(_dataDir + "appartments_mod.pdf");

<% annotation0.feature-page04.h2 %>

<% annotation0.feature-page04.text01 %>

เพิ่มคำอธิบายประกอบ FreeText - C++

String _dataDir("C:\\Samples\\");

// Load the PDF file
auto document = MakeObject<Document>(_dataDir + u"sample.pdf");
auto page = document->get_Pages()->idx_get(1);

auto defaultAppearance = MakeObject<DefaultAppearance>();
defaultAppearance->set_FontName(u"Helvetica");
defaultAppearance->set_FontSize(12);
defaultAppearance->set_TextColor(System::Drawing::Color::get_Blue());

auto freeTextAnnotation = MakeObject<FreeTextAnnotation>(page, new Rectangle(300.0, 770.0, 400.0, 790.0), defaultAppearance);

freeTextAnnotation->set_RichText(u"Free Text Demo");
page->get_Annotations()->Add(freeTextAnnotation);
document->Save(_dataDir + u"sample_freetext.pdf");