Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
첨부파일은 다양한 정보와 다양한 파일 유형을 포함할 수 있습니다. 이 문서에서는 PDF 파일에 첨부파일을 추가하는 방법을 설명합니다.
다음 코드 스니펫은 Aspose.Drawing 라이브러리와 함께 작동합니다.
EmbeddedFiles 컬렉션은 PDF 파일의 모든 첨부파일을 포함합니다. 다음 코드 스니펫은 PDF 문서에 첨부파일을 추가하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void AddEmbeddedFile()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Attachments();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "AddAttachment.pdf"))
{
// Setup new file to be added as attachment
Aspose.Pdf.FileSpecification fileSpecification = new Aspose.Pdf.FileSpecification(dataDir + "test.txt", "Sample text file");
// Add attachment to document's attachment collection
document.EmbeddedFiles.Add(fileSpecification);
// Save PDF document
document.Save(dataDir + "AddAnnotations_out.pdf");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.