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

Creating PDF Structure Tags using FDK

New Here ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

I am trying to include PDF structure tags using the FDK. I set the FP_PDFStructure property in the document object to true, then for each paragraph format I want to include in the structure tags I set the property FP_PDFStructureLevel to an integer value greater then 0. When I look at the output document's PDF settings the tags are not there (i.e Format->Document->PDF Setup). What am I missing here?

Views

126

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
New Here ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

hello, kindly contact me now for free consultation i help you fix pdf structure tags using the FDK if you need extra fast work kindly get in touch with the best working tool now. 

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
New Here ,
Aug 30, 2022 Aug 30, 2022

Copy link to clipboard

Copied

Some additional information on what I am trying to do.

The document had been created and it is time to include the bookmarks and the PDF structure tags:

FmFramemaker::ApiSetInt(FV_SessionId, m_pDocMgr->DocId(), FP_PDFStructure, true);
FmFramemaker::ApiSetInt(FV_SessionId, m_pDocMgr->DocId(), FP_GenerateAcrobatInfo, true);

Then it loops through a list of paragraph format names and level values, executing the following subroutime:

void FmDocContext::AddPdfBookmark(TkString& strPgfFmt, int nLevel)
{
F_ObjHandleT idPgfFmt = FmFramemaker::ApiGetNamedObject(DocId(), FO_PgfFmt, strPgfFmt);
FmFramemaker::ApiSetInt(DocId(), idPgfFmt, FP_AcrobatLevel, nLevel);
FmFramemaker::ApiSetInt(DocId(), idPgfFmt, FP_PDFStructureLevel, nLevel);
}

The functions being called are just the standard FDK API calls with some wrapper code to throw an execption if something goes wrong. Well, no errors are indicated and I'm using the same parameters for the bookmarks and the PDF structure tags. I know the parameters are correct in that the bookmarks are created correctly, but the PDF stucture tags are not.

 

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
Community Expert ,
Aug 30, 2022 Aug 30, 2022

Copy link to clipboard

Copied

I haven't used this in any of my scripts, but I tried a simple ExtendScript test and the value does change when I look at Document > Format > PDF Setup before and after.

 

#target framemaker

var doc, pgfFmt;

doc = app.ActiveDoc;
pgfFmt = doc.GetNamedPgfFmt ("answ_dollars");
alert (pgfFmt.PDFStructureLevel); // Displays 50
pgfFmt.PDFStructureLevel = 49;

alert (pgfFmt.PDFStructureLevel); // Displays 49

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
New Here ,
Aug 30, 2022 Aug 30, 2022

Copy link to clipboard

Copied

Okay, you sort of helped me. Looking at what you did, I decided to check value of the PDF structure level before and after in the debugger and the level was being updated from 0 to the correct value. It occurred that maybe the level needs to be set before the paragraph that uses the style is created and the style is applied, not after the entire document has been generated. That did the trick.

Thanks.

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
Community Expert ,
Aug 30, 2022 Aug 30, 2022

Copy link to clipboard

Copied

LATEST

Right, because if you just apply it to the paragraph format after the paragraphs are created, you are essentially creating an override for each paragraph.

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