Pdf signature on secured file and converting secured pdf file ton PDF/A c#

Good afternoon,

I am currently working on signing PDF file using the pdf signature method provided but noticed it doesn’t sign the signature field even after specifying the signature field explicitly. I created some sample signature field using aspose product and it seemed to work and the difference I noticed between both files is that my original pdf file is secured while the one i created with aspose isn’t secured.

Same thing happens with converting pdf to PDF/A, it works only with files that aren’t secured.

Issue is most of the file I am working with are secured, is there something that we can do to make them work on secured pdf file or is there another approach that we can take to achieve what we need to.

Please let me know if you need anything such as code snippets or example file.

Thank you.

@usz.a

We need to investigate these scenarios in details. Can you please share your sample PDF documents and sample code snippet for our reference so that we can test the scenario in our environment and address it accordingly?

Hi,

Performance Contract.pdf (546.1 KB)

public flattenPdfResponse FlattenPdf(flattenPdfRequest request)
    {

        byte[] byteArray = Convert.FromBase64String(request.encodedFileString);

        MemoryStream mem = new MemoryStream();
        mem.Write(byteArray, 0, byteArray.Length);

        MemoryStream returnMem = new MemoryStream();

        Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(); 

        pdfForm.BindPdf(mem);

        pdfForm.FlattenAllFields();


        pdfForm.Save(returnMem);

        // Pdf to Pdf/A 
        MemoryStream validateMem = new MemoryStream();

        Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(returnMem);
        pdfDocument.Validate(validateMem, PdfFormat.PDF_A_1A);
        pdfDocument.Convert(validateMem, PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);
        pdfDocument.Save(returnMem);


        return new flattenPdfResponse(returnMem.ToArray(), string.Empty, HttpContext?.User?.Identity?.Name ?? "");

    }

As requested, code snippet and file that we are working with.

Thank you

@usz.a

An investigation ticket as PDFNET-53036 has been logged in our issue tracking system for further analysis on this case. We will look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.