Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
La clase PdfFileInfo te permite establecer información específica del archivo de un archivo PDF. Necesitas crear un objeto de la clase PdfFileInfo y luego establecer diferentes propiedades específicas del archivo como Autor, Título, Palabra Clave y Creador, etc. Finalmente, guarda el archivo PDF actualizado utilizando el método SaveNewInfo del objeto PdfFileInfo.
El siguiente fragmento de código te muestra cómo establecer la información del archivo PDF.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void SetPdfInfo()
{
// Define the directory for input and output files
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Create PdfFileInfo object to work with PDF metadata
using (var fileInfo = new Aspose.Pdf.Facades.PdfFileInfo(dataDir + "sample.pdf"))
{
// Set PDF information
fileInfo.Author = "Aspose";
fileInfo.Title = "Hello World!";
fileInfo.Keywords = "Peace and Development";
fileInfo.Creator = "Aspose";
// Save the PDF with updated information
fileInfo.SaveNewInfo(dataDir + "SetFileInfo_out.pdf");
}
}
El método SetMetaInfo te permite agregar cualquier información. En nuestro ejemplo, añadimos un campo. Consulta el siguiente fragmento de código:
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void SetMetaInfo()
{
// Define the directory for input and output files
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Create an instance of the PdfFileInfo object
using (var fileInfo = new Aspose.Pdf.Facades.PdfFileInfo(dataDir + "sample.pdf"))
{
// Set a new custom attribute as meta info
fileInfo.SetMetaInfo("Reviewer", "Aspose.PDF user");
// Save the updated file
fileInfo.SaveNewInfo(dataDir + "SetMetaInfo_out.pdf");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.