What I need to do
I'm writing tests and currently trying to check whether or not our PDF get's correctly stamped on the first page. For this, I tried to search the page for the stamp text which did not work because it appears that this stamp is not on the text layer or whatever. In short: I do not know where to look for the stamp.
What the stamping service does
PdfStamper = new PdfStamper(Stamper.mPDFSource, Stamper.mStreamOut);
PdfContentByte canvas = stamper.GetOverContent(mPage);
PdfPTable table = new PdfPTable(1);
table.SetTotalWidth(new float[] { table_width });
Font cellFont = new Font(Font.FontFamily.HELVETICA, mFontSize, Font.NORMAL, textcolor);
Phrase phrase = new Phrase(cell_text, cellFont);
PdfPCell cell = new PdfPCell(phrase);
table.AddCell(cell);
table.WriteSelectedRows(0, strRows.Length, xpos, ypos, canvas);
What I think to have found out
- The threads I've read tell me stamps created this way basically become annotations. I've yet to find an example where a table is used though.
- If the previous is correct, why does the following return null? This has been named the solution in different threads.
.
PdfReader.GetPdfObject(pdfDictionary.Get(PdfName.ANNOTS));
PdfReader.GetPdfObject(pdfDictionary.Get(PdfName.ANNOT));
pdfDictionary.GetAsArray(PdfName.ANNOT);
pdfDictionary.GetAsArray(PdfName.ANNOTS);
iTextSharp: 5.3.5.0 .Net: 4.0
Where/how can I find the stamps?
Regards annih