Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.PDF pode remover anexos de arquivos PDF. Os anexos de um documento PDF são mantidos na coleção EmbeddedFiles do objeto Document.
O seguinte trecho de código também funciona com a biblioteca Aspose.PDF.Drawing.
Para excluir todos os anexos associados a um arquivo PDF:
O seguinte trecho de código mostra como remover anexos de um documento 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.