Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Seattle, Washington, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retaining outline numbering after PDF conversion (2002, SP-2)

    Using Adobe Acrobat 6.0's PDF Maker add-in, I regularly convert long Word docs to PDFs.

    Nearly all the docs I convert have outline-numbered headings (1, 1.1, 1.1.1, etc.). In my conversion settings, I convert Word headings to bookmarks, so people reading my PDFs will have an easy way to navigate.

    Trouble is, although the text of the PDF doc looks fine and I do get bookmarks, the bookmarks themselves do not include the outline numbering...just the text of the headings.

    How can I get the numbering to survive the Word-to-PDF conversion, and appear in the bookmarks?

    Many thanks,
    Erik

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Retaining outline numbering after PDF conversion (2002, SP-2)

    I am guessing this is by design. The VBA macros used by Acrobat to create the bookmark tags is locked so you cant change that however you could modify a copy of your Word document before letting Acrobat loose on the file so that the paragraph numbering gets through to the PDF in the tags. This would be done by converting all the automatic numbering to hard coded numbering. This is not so good if you later want to edit the file so you should do it to a copy.

    The code which manages the conversion of the file looks like this.
    <pre>Sub NumberingAutoToHardcoded()
    'Andrew Lockton - Chrysalis Design
    'converts autonumbers to hard coded
    Dim iResp As Integer
    iResp = MsgBox("This macro converts automatic paragraph numbers to hard coded." _
    & vbCr & "Click Yes to convert the entire document." & vbCr & _
    "Click No to convert only the selected paragraphs." & vbCr & _
    "Click Cancel to stop the macro.", _
    vbYesNoCancel, "Delete Hard Numbers")
    If iResp = vbYes Then
    ActiveDocument.ConvertNumbersToText (wdNumberAllNumbers)
    ElseIf iResp = vbNo Then
    Selection.Range.ListFormat.ConvertNumbersToText (wdNumberAllNumbers)
    End If
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Seattle, Washington, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retaining outline numbering after PDF conversion (2002, SP-2)

    Just coming back to this project...

    Thanks for the suggestion and for your expertise. I'll give the macro a try and let you know how it goes.

    Cheers,
    Erik

  4. #4
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Seattle, Washington, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retaining outline numbering after PDF conversion (2002, SP-2)

    I am finally picking up the project I inquired about a year ago. I used Andrew's macro, which did indeed convert the outline numbering to hard numbering. But this has introduced another problem in PDF conversion.

    I am now using Word 2002 SP3 and Acrobat 6.0.0.

    The problem is automated cross-references in Word; they are broken in the PDF. Correct me if I'm wrong, but I'd guess the following is happening:

    1. I convert outline numbering using Andrew's macro
    2. Fields are automatically updated during PDF conversion
    3. Cross-references to "numbered items" can no longer be found, since the numbering is no longer recognized, as it's been converted to hard text
    4. A cross-ref field whose output formerly read, e.g., "10.4.1" (the number of the section heading) now says "0"

    Can anyone advise a workaround? My goal is for the PDF document to function as much like the Word document as possible: automatic hyperlinked x-refs in text, and numbered headings in "Document Map".

    Thank you,
    Erik

  5. #5
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retaining outline numbering after PDF conversion (2002, SP-2)

    I don't have the PDFMaker Add-in (I use GhostWord/GhostScript) so I can't test this, but maybe try locking the xrefs before running Andrew's macro:

    <pre>Sub LockXRefFields()
    Dim fld As Field
    For Each fld In ActiveDocument.Fields
    If fld.Type = wdFieldRef Then
    fld.Update
    fld.Locked = True
    End If
    Next fld
    End Sub
    </pre>


  6. #6
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Seattle, Washington, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retaining outline numbering after PDF conversion (2002, SP-2)

    Andrew S, thanks for the help with locking xrefs before running Andrew L's macro. On first test it seems to work.

    I'm a bit VBA-ignorant, so could you tell me: is it possible to do the same for STYLEREF fields? I use them (referring to Heading 1) in my page headers; after running Andrew L's macro the outline number is included in the header, which I don't want.

    Cheers,
    Erik

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Retaining outline numbering after PDF conversi

    I think your guess is pretty much spot on for why the links are breaking.

    Perhaps the macro is not actually updating the fields directly. It definately saves the file and then does a whole lot of link creation before printing the file. If you have set your options to update the fields on print then this might be the culprit.

    I don't know how badly you want to solve this issue but it is possible that other tools such as the free ghostscript converters might bring in the paragraph numbers to the bookmarks.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Retaining outline numbering after PDF conversi

    You might be better off to lock all fields regardless of type. Do this by removing the If and End If lines from the macro.

    Because the fields in question are resident in the header you may need to run the macro across each story type.
    Sub updateAllfields()
    Dim astory As range
    Dim afield As field
    For Each astory In ActiveDocument.storyranges
    For Each afield In astory.fields
    afield.update
    afield.locked = true
    Next afield
    Next astory
    End Sub
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •