1

I am trying to add text using ItextSharp Version 5.5.6.0 On one of the segments we are using PdfContentByte to write the text Assume that pdfPageContents is the instance of PdfContentByte with the content byte

        pdfPageContents.SaveState();
        pdfPageContents.BeginText();
        pdfPageContents.SetFontAndSize(bf, fontSize);
        pdfPageContents.SetColorFill(color);
        pdfPageContents.ShowTextAligned(Aling, text, xy.x, xy.y, rotation);
        pdfPageContents.EndText();

I have also try

        ColumnText ct = new ColumnText(pdfPageContents);
        ct.SetSimpleColumn(50, 500, 500, 50);
        ct.SetText(new Phrase(1,new Chunk(text)));
        ct.Go();

But in both cases the text gets added but is not include in the tagged structure of the document.

enter image description here

but my Tagged structure does not include that image First 2 items are been added in world and they have the tagged structure

enter image description here

There are only 4 tags 1 for the first text 2 for spaces and 1 for the image, the tagged structure is the same as before adding the "Hello Sir"

Is there any setting that i am missing or is there a work around?

  • 1
    When you take control (e.g. by using `PdfContentByte`), you are responsible to take care of the tagging yourself. See for instance how the methods `beginMarkedContentSequence()` and `endMarkedCOntentSequence()` are used in my answer to the question [iText page number in header within PDF/A](http://stackoverflow.com/questions/27500586/itext-page-number-in-header-within-pdf-a). Automatic tagging is only done when you use high-level objects. When you use absolute positioning, you need to add the tags yourself through code. – Bruno Lowagie Nov 05 '15 at 18:04
  • I am currently adding it using PdfStamper and creating the with FileStream passing the byte array. by changing my PdfContentByte to use beginMarkedContentSequence and the ARTIFACT property it does not look to be adding the tag, can you please provide and example, Thanks for your help. – Christopher Cabezudo Rodriguez Nov 05 '15 at 18:32
  • Please contact customer support at iText Software. If you're not a customer, you probably won't get an answer as you're using functionality that is commercially interesting. – Bruno Lowagie Nov 05 '15 at 18:33
  • Wait support is only available to the commercial licencing, does this means that AGPL do not have this functionality? or are we force to pay for licencing now even when what we are doing are experiments that as required are disclose with the rest of the world under the same AGPL requirements. – Christopher Cabezudo Rodriguez Nov 05 '15 at 18:50
  • 1
    You are asking for time and resources. Time and resources are not free. That's obvious, isn't it? – Bruno Lowagie Nov 05 '15 at 18:59
  • Yeah, that is why i am asking on stackoverflow :D, just to make sure i am still using AGPL rigth, Thanks Bruno for your time, BTW awesome book on the main product – Christopher Cabezudo Rodriguez Nov 05 '15 at 19:03

0 Answers0