AndyHu
AndyHu

Reputation: 1418

How to add stamp to PDF in C# using Adobe predefined templates?

The task is to add a stamp to existing pdf files. I tried the code in this SO answer using iTextSharp and the stamp style is like this: enter image description here

But the I want the stamp looks like what Adobe provided:enter image description here

Is there any library provide stamp annotation style like this? Thanks in advance.

Upvotes: 0

Views: 1649

Answers (1)

joelgeraci
joelgeraci

Reputation: 4917

You can't... at least not legally. Adobe distributes that stamp and their stamps in general as PDF files that are in a specific folder of the application and have some special attributes that make them visible in the Acrobat UI. They are considered part of the Acrobat product and are subject to the same licensing restrictions as the executable itself. That's why iText came up with their own version for their sample.

However, you can add a stamp annotation that uses the same name as the Adobe Approved stamp "SBApproved" but without an appearance dictionary. In that case, the PDF viewer will generate its own appearance for the stamp (if it can) and the viewer's equivalent of the "SBApproved" stamp will be shown. Unfortunately, it will only look like the Adobe version when opened in an Adobe viewer. Because not all viewers have the ability to generate annotation apppearances, I don't recommend this appraoch. Bruno's answer in the question you referenced explains this a bit further... quoting... emphasis mine.

Note that a PDF viewer should have predefined icons for at least the following names: Approved, Experimental, NotApproved, AsIs, Expired, NotForPublicRelease, Confidential, Final, Sold, Departmental, ForComment, TopSecret, Draft, ForPublicRelease. What these icons look like will depend from viewer to viewer.

My advice is to come up with your own design for the stamp and use it.

Upvotes: 1

Related Questions