Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //pdf file
            string input = "..\\..\\..\\..\\..\\..\\..\\Data\\Sample7.pdf";

            //open pdf document
            PdfDocument doc = new PdfDocument(input);

            //get all attachments
            PdfAttachmentCollection attachments = doc.Attachments;

            //delete all attachments
            attachments.Clear();

            string output = "DeleteAllAttachments.pdf";

            //save pdf document
            doc.SaveToFile(output);

            //Launching the Pdf file
            PDFDocumentViewer(output);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string input = @"..\..\..\..\..\..\Data\DeleteAllAttachments.pdf";

            //Open pdf document
            PdfDocument doc = new PdfDocument();

            doc.LoadFromFile(input);

            //Get all attachments
            PdfAttachmentCollection attachments = doc.Attachments;

            //Delete all attachments
            attachments.Clear();

            string output = "DeleteAllAttachments.pdf";

            //Save pdf document
            doc.SaveToFile(output);

            //Launch the Pdf file
            PDFDocumentViewer(output);
        }