I’m trying to check and remove Signature from pdf files.
Can anybody tell how to do it?
Thanks
This is my test code
auto sign = System::MakeObject<Aspose::Pdf::Facades::PdfFileSignature>();
sign->BindPdf(u"东光县第二水厂改扩建项目二标段设备安装(工程量清单)(1) - 副本.PDF");
if (sign->ContainsSignature()) {
printf("有签名\n");
}
else {
printf("没有签名\n");
}
But got error: 0x00007FFE68F7A719 处(位于 pdfTest.exe 中)有未经处理的异常: Microsoft C++ 异常: System::ExceptionWrapper<System::Details_ArgumentOutOfRangeException>,位于内存位置 0x0000009424DFCD10 处。 出现了
We have logged an issue as PDFCPP-1493 in our issue tracking for this case. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.
The issue has been fixed in 21.1 version of the API which will be released in January 2021. You will surely receive a notification as soon as the fixed-in version is published.
Today I tested this file again.
It failed with save();
But works with save(u"导热硅胶2021REACH英文-removed.pdf");
Another problem : the file saved with 导热硅胶2021REACH英文-removed.pdf, still can not be edit. And have signature warnning.图片.png (16.8 KB)
Test SDK: Pdf for C++ 21.3
License: Loaded
Test code:
void pdfRemoveSignature() {
auto filename = System::String(u"导热硅胶2021REACH英文.pdf");
auto sign = System::MakeObject<Aspose::Pdf::Facades::PdfFileSignature>();
sign->BindPdf(filename);
if (sign->ContainsSignature()) {
printf("有签名\n");
}
else {
printf("没有签名\n");
return;
}
auto names = sign->GetSignNames();
for (int i = 0; i < names->get_Count(); i++) {
std::cout << names->idx_get(i) << "\n";
sign->RemoveSignature(names->idx_get(i));
}
sign->Save();// (u"导热硅胶2021REACH英文-removed.pdf");
}
We have logged another issue as PDFCPP-1570 in our issue tracking system for further investigation. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.
We have logged another ticket as PDFCPP-1573 in our issue tracking system for this file. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.
How can I remove signature of one page.
I got a pdf file which got System::ApplicationException: You cannot change this document because it is certified.
I tried to split(OK), add signature(Failed), remove the first page and add signature(OK).
This file cannot be uploaded. Sorry.
We are afraid that we cannot address the issue until we get a sample PDF that is causing problem at your end. Please try to manage a sample document to share with us so that we can further proceed to assist you accordingly.
An issue as PDFCPP-1612 has been logged as PDFCPP-1612 in our issue tracking system for your this file. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.