Hi
I am converting a word document to PDF using Aspose.Words.
I then use Aspose.Pdf.Facades.Stamp to apply a text or image stamp to the PDF.
I then use Aspose.Pdf.Document to convert the document to a PDF/A format.
The issue is that the resulting PDF does not contain the stamp and is not PDF/A compliant, if I don’t apply the stamp and convert the document the result is PDF/A compliant.
My question is, should I be able to convert a stamped document to a PDF/A format or is it not possible?
I can supply code and conversion logs files if required, I’d rather not post them in open forum.
Many thanks
@james.sales
Thanks for contacting support.
We have tested the scenario with Aspose.Pdf for .NET 17.11 and were able to convert one of our sample stamped PDFs into PDF/A-1a format.
You may please share your sample files and code snippet in a private message, so that we can test the scenario in our environment and address it accordingly.
@asad.ali
Thanks for the prompt response. Would you be able to share your test code with me?
@james.sales
Thanks for writing back.
Please check following code snippet, which we have used to test the scenario in our environment:
// Open document.
Document pdfDocument = new Document("Original.pdf");
// Create stamp.
TextStamp textStamp = new TextStamp("Text Stamp")
{
BottomMargin = 10,
LeftMargin = 10,
RightMargin = 10,
VerticalAlignment = VerticalAlignment.Bottom,
HorizontalAlignment = HorizontalAlignment.Left
};
// Process all pages.
foreach (Page page in pdfDocument.Pages)
{
// Add stamp.
page.AddStamp(textStamp);
}
pdfDocument.Convert(new MemoryStream(), PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);
// Save the file.
pdfDocument.Save("Original_StampedOut.pdf");
@asad.ali
Many thanks for your help, the code you supplied helped me identify the issue in my own code.
@james.sales
Thanks for your feedback.
It is good to know that your issue has been resolved. Please keep using our API and in event of any further query, feel free to create a new topic. We will be more than happy to assist you accordingly.