Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
PdfFileInfo класс позволяет вам установить информацию о файле PDF. Вам нужно создать объект класса PdfFileInfo и затем установить различные свойства, специфичные для файла, такие как Автор, Заголовок, Ключевое слово и Создатель и т.д. Наконец, сохраните обновленный PDF файл, используя метод SaveNewInfo объекта PdfFileInfo.
Следующий фрагмент кода показывает, как установить информацию о 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");
}
}
SetMetaInfo метод позволяет вам добавлять любую информацию. В нашем примере мы добавили поле. Проверьте следующий фрагмент кода:
// 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.