Код: Выделить всё
Aspose.Pdf.Facades.StampInfo[] stampInfo = contentEditor.GetStamps(1);
contentEditor.BindPdf(@"C:\Downloads\Бух.pdf");
contentEditor.DeleteStamp(1, new int[] { stampInfo.FirstOrDefault().IndexOnPage });//.DeleteStampById(stampInfo.StampId);
contentEditor.Save(@"C:\Pr\Бух(v1).pdf");
Но при попытке чтения из потока возникает ошибка:
Aspose.Pdf.InvalidPdfFileFormatException: «Неверный заголовок файла»
Код: Выделить всё
[Public]
public virtual System.IO.Stream FunctionBarcode(System.IO.Stream stream)
{
Aspose.Pdf.Facades.PdfContentEditor contentEditor = new Aspose.Pdf.Facades.PdfContentEditor();
contentEditor.BindPdf(stream);
Aspose.Pdf.Facades.StampInfo[] stampInfo = contentEditor.GetStamps(1);
contentEditor.DeleteStamp(1, new int[] { stampInfo.FirstOrDefault().IndexOnPage });
contentEditor.Save(stream);
return stream;
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... e-pdf-file