Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.PDFはPDFファイルから添付ファイルを削除できます。PDFドキュメントの添付ファイルは、DocumentオブジェクトのEmbeddedFilesコレクションに保持されています。
次のコードスニペットは、Aspose.PDF.Drawingライブラリでも動作します。
PDFファイルに関連付けられたすべての添付ファイルを削除するには:
次のコードスニペットは、PDFドキュメントから添付ファイルを削除する方法を示しています。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void DeleteAllAttachments()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Attachments();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "DeleteAllAttachments.pdf"))
{
// Delete all attachments
document.EmbeddedFiles.Delete();
// Save PDF document
document.Save(dataDir + "DeleteAllAttachments_out.pdf");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.