Impor anotasi format FDF ke PDF melalui C#

Contents
[ ]

PDFAnnotationEditor kelas berisi metode untuk bekerja dengan impor anotasi dari file FDF. Metode PdfAnnotationEditor.ImportAnnotationsFromFdf menyediakan fungsionalitas untuk mengimpor anotasi dari dokumen FDF ke file PDF.

Selain itu, Kelas Form menyertakan metode Form.ImportFdf - mengimpor konten bidang dari file FDF dan menempatkannya ke dalam PDF baru.

Potongan kode berikut menunjukkan kepada Anda cara Mengimpor anotasi format FDF ke PDF dengan metode Form.ImportFdf():

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ImportFDFByForm()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

    using (var form = new Aspose.Pdf.Facades.Form(dataDir + "input.pdf"))
    {
        // Open FDF file
        using (var fdfInputStream = new FileStream(dataDir + "student.fdf", FileMode.Open))
        {
            form.ImportFdf(fdfInputStream);
        }
        // Save PDF document
        form.Save(dataDir + "ImportDataFromPdf_Form_out.pdf");
    }
}

Potongan kode berikut menunjukkan cara mengimpor anotasi format FDF ke PDF dengan metode PdfAnnotationEditor.ImportAnnotationsFromFdf():

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ImportFdfByPdfAnnotationEditor()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "input.pdf"))
    {
        var editor = new Aspose.Pdf.Facades.PdfAnnotationEditor();
        // Bind PDF document
        editor.BindPdf(dataDir + "input.pdf");
        editor.ImportAnnotationsFromFdf(dataDir + "student.fdf");
        // Save PDF document
        editor.Save(dataDir + "ImportDataFromPdf_AnnotationEditor_out.pdf");  
    }
}