Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Le code suivant fonctionne également avec la bibliothèque Aspose.PDF.Drawing.
Pour remplir un champ de formulaire, obtenez le champ de la collection Form de l’objet Document. Ensuite, définissez la valeur du champ en utilisant la propriété Value du champ.
Cet exemple sélectionne un TextBoxField et définit sa valeur en utilisant la propriété Value.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void FillFormField()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Forms();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "FillFormField.pdf"))
{
// Get a field
if (document.Form["textbox1"] is Aspose.Pdf.Forms.TextBoxField textBoxField)
{
// Modify field value
textBoxField.Value = "Value to be filled in the field";
}
// Save PDF document
document.Save(dataDir + "FillFormField_out.pdf");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.