We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert PDF to PDFA using C# and Aspose.PDF | Attachment is missing in output

Hello,
Recently I started to use Aspose library instead Pdf2PdfAPI for converting PADES (signed pdf) to PDFA. Actually, I know, that it is no way to correct converting signatures to pdfA, so before it was used like pdf as it is was converted to pdfA, and original pades (signed pdf) was attached as ordinary attachment (see source.pdf). In library Pdf2PdfAPI it was converted without any problems (see output_correct.pdf). Unfortunately, via Aspose I am able to attach original attachment and convert to PDFA, but as result I see converted to pdfA file only, but without attachments (output_incorrect.pdf). And file is much bigger as when it was converted by Pdf2PdfAPI.
Below is my step-by-step for PDFA producing from PADES. Could you please provide me how I can achive the same result as in output_correct.pdf, which was created by Pdf2PdfAPI.

PdfFileSignature pdfSign = new PdfFileSignature();
// Open PDF document
pdfSign.BindPdf(streamInput);
// Get list of signature names
var names = pdfSign.GetSignNames();
// Remove all the signatures from the PDF file
for (int index = 0; index < names.Count; index++)
{
pdfSign.RemoveSignature((string)names[index]);
}
// Save updated PDF file
pdfSign.Save(stream);

var memoryStream = new MemoryStream();
memoryStream.Write(content, 0, content.Length);
memoryStream.Position = 0L;
FileSpecification fspec = new FileSpecification(memoryStream, originalName);
pdfDocument.EmbeddedFiles.Add(fspec);

if (pdfDocument.Convert(msLogOutput, pdfFormatEnum, ConvertErrorAction.Delete))
{

using (var outputStream = new MemoryStream())
{
	pdfDocument.Save(outputStream);
	outputStream.Position = 0;
	result.Content = outputStream.ToArray();
	result.Success = true;
}

}

Thank you,
Denis.
output_incorrect.pdf (381.1 KB)
output_correct.pdf (106.3 KB)
source.pdf (305.9 KB)

@mvesely

We were able to replicate the issue in our environment while testing the scenario with Aspose.PDF for .NET 21.5. Therefore, have logged an issue as PDFNET-49916 in our issue tracking system. 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.

We are sorry for the inconvenience.

Hello,
how it looks like with this problem fixing? We are waiting for that, because, this issue on customer’s side.
Thank you.

@mvesely

The issue has recently been logged in our issue tracking system and we are afraid that it is pending for analysis. It was logged under normal/free support model and will be investigated on a first come first serve basis. We will surely inform you as soon as we have some definite updates regarding resolution of the ticket. Please spare us some time.

We apologize for the inconvenience.