Gestion des propriétés de document en PHP
Contents
[
Hide
]
Aspose.Cells - Ajout de propriétés personnalisées
Pour ajouter des propriétés de document personnalisées à l’aide de Aspose.Cells Java for PHP, appelezadd_custom_property méthode de laDocument module.
Code PHP
//Instantiate a Workbook object by excel file path
$workbook = new Workbook($dataDir . "Book1.xls");
//Retrieve a list of all custom document properties of the Excel file
$customProperties = $workbook->getWorksheets()->getCustomDocumentProperties();
//Accessing a custom document property by using the property index
$customProperty1 = $customProperties->get(3);
//Accessing a custom document property by using the property name
$customProperty2 = $customProperties->get("Owner");
//Adding a custom document property to the Excel file
$publisher = $customProperties->add("Publisher", "Aspose");
//Save the file
$workbook->save($dataDir . "Test_Workbook.xls");
//Removing a custom document property
$customProperties->remove("Publisher");
//Save the file
$workbook->save($dataDir . "Test_Workbook_RemovedProperty.xls");
Télécharger le code d’exécution
Télécharger**Accès aux propriétés du document (Aspose.Cells)**à partir de l’un des sites de codage social mentionnés ci-dessous :