Skip to main content
Participant
August 29, 2022
Question

Creating PDF Structure Tags using FDK

  • August 29, 2022
  • 2 replies
  • 216 views

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?

    This topic has been closed for replies.

    2 replies

    Participant
    August 30, 2022

    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.

     

    frameexpert
    Community Expert
    Community Expert
    August 30, 2022

    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
    Participant
    August 30, 2022

    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.

    Participant
    August 30, 2022

    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.