• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to Create Custom PDF Tags Using IStructureMarks in InDesign?

Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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>

TOPICS
How to , SDK

Views

391

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

Hi Mod, why did you rename my post? 

The current title has nothing to do with my question.

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

Thank you. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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.

Screen Shot 2024-09-26 at 17.30.55.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

Hello Dirk,

 

Thank you for the very thoughtful reply.

 

I can get the tags via IExportTagValues. What I am looking for is some thing much lower. I want to intercept the actual pdf export and determine the type of tag that would be inserted into the pdf / epub structure and insert my own tags, overriding what ID would insert.

 

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 27, 2024 Sep 27, 2024

Copy link to clipboard

Copied

LATEST

Some good hints there, thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines