Skip to main content
Legend
September 26, 2024
Question

How to Create Custom PDF Tags Using IStructureMarks in InDesign?

  • September 26, 2024
  • 3 replies
  • 1312 views

Hi,

 

I would like to make custom pdf tags.

I wonder is IStructureMarks the way to go. 

The documentation is a bit thin. 

Any suggestions, sample code would be very appreciated.

 

P

 

 

<Title renamed by MOD>

This topic has been closed for replies.

3 replies

Legend
September 26, 2024

Now looking at IStructureMarks, which is documented to be aggregated on the gPort.

Sounds like draw events translated to an interface, but at a better granularity. Never seen that particular one.

It is on kPDFViewPortBoss and kDynDocsExportViewPortBoss, so check the class for the right export.

Actual call to BeginParagraph is deep in wax drawing, when the interface is found.

Hmm, could be if you modify the IExportTagValues of your style using the mentioned command somewhere before PDF output takes off, and restore it at the end, that BeginParagraph would pick it up from there.

 

PickoryAuthor
Legend
September 27, 2024

Some good hints there, thank you.

Legend
September 26, 2024

If possible, please describe what you want to achieve, using UI steps.

E.g. is that the same as adding "Structuring tags" – that would be XML tags via the tags panel rather than "PDF tags"?

https://helpx.adobe.com/indesign/using/structuring-pdfs.html

PickoryAuthor
Legend
September 26, 2024

Hi Dirk,

 

Thank you for taking the time to look.

 

From the UI, see pic. I want to insert my own tags where you see H2.

 

I know these would normally be used for accesibility, but I have my own reason for overriding these.

 

Thanks.

 

P.

Legend
September 26, 2024

Hmm, the highlighted upper kEPUBTagEditBoxWidgetID is EPUB rather than PDF.

kSetStyleExportTagValueCmdBoss(0xCA2A)

IID_IWSTRINGDATA "EPUB"

IID_IEXPORTTAG "xx"

other interfaces matching their widgets.

As a kTextComboBoxWidgetBoss you can modify the text.

There is no separate command to produce some "xx" tag.

The values end up within IID_IEXPORTTAGVALUES of the kStyleBoss, but there is no notification on that change.

 

The lower kPDFTagEditBoxWidgetID uses the same command, but

IID_IWSTRINGDATA "PDF"

As kDropDownListWidgetBoss the user can't add other tags.

 

When I use kXMLCreateTagCmdBoss via Tags panel the new tag is still not offered, even though the tags panel is mentioned in the above article. Thus my question, can you add to that dropdown using the UI?

 

Speculation / did not try: Feels like not so much. I wonder if you address the widget and add a translatable string to the IID_ISTRINGLISTCONTROLDATA where the translation is your tag, what happens then? I would not suggest that though, because when you open the dialog without your plug-in such a value may confuse the dropdown setup.

 

If you need your own tag, how about going via XML structure, XML story along the article?

PickoryAuthor
Legend
September 26, 2024

Hi Mod, why did you rename my post? 

The current title has nothing to do with my question.

P.

Abhishek Rao
Community Manager
Community Manager
September 26, 2024

Hi @Pickory,

 

I apologize for the confusion, it looks like the title might have been accidentally replaced with another community post. I’ve now corrected it to better reflect your question. Thank you for pointing it out!

 

Could you also share the version of InDesign you're using and your OS details? That will help us provide more specific guidance.

Feel free to reach out if you have any other questions!

 

Thanks,
Abhishek Rao

PickoryAuthor
Legend
September 26, 2024

Thank you. 🙂