Pdf Compliance is lost working when used in stream

While creating a PDF document from memory stream the document is generated but is losing the applied compliance value. When applying a value from PDFCompliance enum between (4 to 7) i.e. (PdfA2a, PdfA2u, PdfA4 and PdfUa1) and converting the memory stream to Pdf it is losing the compliance applied in the generated document. Whereas when applying value between (0 to 3) i.e. (Pdf17, Pdf20, PdfA1a, PdfA1b) the pdf document generated holds the compliance applied.

All the pdf compliance levels work when the pdf is saved locally on the filepath with ‘.pdf’ extension. We require memory stream for various actions so we need the output to be in that format.

Source code:

 Document doc = new Document(dir + "aws.docx");
 using MemoryStream pdfDocStream = new();
 PdfSaveOptions options = new PdfSaveOptions();
 options.Compliance = PdfCompliance.PdfA2u;
 
 doc.Save(pdfDocStream, options);
 var pdfDocument = new Aspose.Pdf.Document(pdfDocStream);
 pdfDocument.Save(dir + "Transformed.pdf");

This is the input file: aws.docx (22.9 KB)
This is the output file when PdfA2u is applied: PdfA2u.pdf (98.2 KB)
This is the output file when PdfA1a is applied: PdfA1a.pdf (99.5 KB)

1 Like

@sujaiswal

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54764

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello @asad.ali, we already have a paid license for Aspose which includes paid support.

Also, we tried reading PDF Compliance file from local repository.
eg,
var doc = new Aspose.Pdf.Document(filepath);

but in this scenario also the document “doc” is also not Pdf Complianced.

@sujaiswal

If you have a paid support subscription, you can please create a post there with the reference of ticket ID logged here and your issue will be escalated to the maximum priority.

This is the Issue Id created under this chat:
Issue ID(s): PDFNET-54764

We wanted to know the status on this tickets and whether this has been resolved in the new Aspose version.

We do have the Aspose License and that includes paid support as well but just wanted to continue on this thread

@sampatil

Sadly, the earlier logged ticket was not resolved due to other issues in the queue. It was never escalated to the priority support and is still pending for resolution. It will be prioritized on a first come first serve basis and as soon as it is resolved, we will update you via this forum thread.