<</Type/Annot
/MyStuff <<
/Label (id)
/AnotherLabel (id)
>>
Currently, the only way I have been able to do it is via
imagemagick/ghostscript as such:
. convert tiff -> postscript via imagemagick/ghostscript
. add the following text to the .ps file: [ /MyStuff << /Label (id)
/AnotherLabel (id) >> /ANN pdfmark
. convert the ps -> pdf via imagemagick/ghostscript
I am trying to get rid of the postscript step, it seems excessive and
clunky(?)
I have been able to do it via iTextSharp Annotation method but the format
ends up all wrong. When I open the ending .pdf file it looks like:
"<</Subtype/Text/Contents(this is my blurb)/T(myTitle)/Rect[36 788 56
768]>>"
...which doesn't work for what I need.
Does anyone know of a .NET compatible application that is capable of doing
this conversion without having to first go to postscript and manually adding
text? Am I missing something in ImageMagick or iTextSharp? Or, is there a
better utility do accomplish this conversion with the appended text
information? Something that can be programmatically accessed...not command
line or gui only.
Any help would be appreciated, as I am a c# developer, and pdf/ps is not my
area of expertise, so I am kind of at a loss as to my possible options.
TIA,
-John.
PdfAnnotation annot = new PdfAnnotation(writer, null);
annot.Put(PdfName.TYPE, PdfName.ANNOT);
PdfDictionary dic = new PdfDictionary();
dic.Put(new PdfName("Label"), new PdfString("id"));
dic.Put(new PdfName("AnotherLabel"), new PdfString("id"));
annot.Put(new PdfName("MyStuff"), dic);
writer.AddAnnotation(annot);
Best Regards,
Paulo Soares