如何将“来自图像的印章注释”导出到图像文件?
我有一个包含戳记注释的 pdf(实际上它是一个图像),我想将所有这些类型的图像导出到文件并获取 x/y 位置。
我是pdf新手。任何想法或代码将不胜感激。
[--- 编辑于 2019/08/08 ---]
private void btnExtractAnnotaion_Click(object sender, EventArgs e) { PdfReader reader = new PdfReader(this.txtPdf.Text); PdfDictionary pageDict = reader.GetPageN(reader.NumberOfPages); PdfArray annotArray = pageDict.GetAsArray(PdfName.ANNOTS); PdfObject annot = null; Console.WriteLine("Annotation count:{0}", annotArray.Size); for (int i = 0; i < annotArray.Size; i++) { annot = annotArray.GetDirectObject(i); Console.WriteLine(annot.ToString()); //curAnnot = annotArray.GetAsDict(i); //Console.WriteLine(curAnnot.ToString()); bool btmp = annot.IsDictionary(); if (btmp) { PdfDictionary pdfDic = ((PdfDictionary)annot); PdfName stamp = pdfDic.GetAsName(PdfName.SUBTYPE); if (stamp.Equals(PdfName.STAMP)) { //PdfObject img = pdfDic.GetDirectObject(PdfName.RECT); // How Can I get the image(png, jpg...) of Stamp? } }