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

Combine Document Preserving Document Names

Guru ,
Mar 11, 2018 Mar 11, 2018

I am looking to combine multiple PDFs using the "Interapplication Communication API Reference"

The below snippet will combine the documents and preserve the layers it won't give the same results as creating a binder using the UI combine documents button

The difference being 1) The combine button creates layers for each PDF document and with the document layers created as sub layers whereas the snippet just created the doc layers without the parent layers as per document name. 2) The button automatically creates bookmarks for each document, the snippet doesn't.

Any ideas how to at least get point 1 working. It's for windows and either powershell or vbs would be easiest.acrobat_layers.png

Edit: I see the bottom red bottom red arrow is in the wrong place so please use your imagination to put it in the correct place 🙂

call main

sub main

    Dim app

    Set app = CreateObject("AcroExch.App")

    Set destDoc = CreateObject("AcroExch.PDDoc")

    Set doc1 = CreateObject("AcroExch.PDDoc")

    Set doc2 = CreateObject("AcroExch.PDDoc")

    Set doc3 = CreateObject("AcroExch.PDDoc")

    src1Path = "C:\Users\Trevor\Creative Cloud Files\PDF\1.pdf"

    src2Path = "C:\Users\Trevor\Creative Cloud Files\PDF\2.pdf"

    src3Path = "C:\Users\Trevor\Creative Cloud Files\PDF\Poly2-01.ai"

    destPath ="C:\Users\Trevor\Creative Cloud Files\PDF\dest.pdf"

    destDoc.Create

    doc1.open src1Path

    doc2.open src2Path

    doc3.open src3Path

    destDoc.InsertPages destDoc.GetNumPages() - 1, doc1, 0, 1, 1

    destDoc.InsertPages destDoc.GetNumPages() - 1, doc2, 0, 1, 1

    destDoc.InsertPages destDoc.GetNumPages() - 1, doc3, 0, 1, 1

    destDoc.Save &H1, destPath

    ' doc1.Close()

    ' doc2.Close()

    ' doc3.Close()

    ' destDoc.close;

    app.Exit

end sub

TOPICS
Acrobat SDK and JavaScript
1.0K
Translate
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

correct answers 1 Correct answer

Community Expert , Mar 12, 2018 Mar 12, 2018

For this you must create layer groups. May be not possible with IAC.

Translate
Community Expert ,
Mar 12, 2018 Mar 12, 2018

For this you must create layer groups. May be not possible with IAC.

Translate
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
Guru ,
Mar 12, 2018 Mar 12, 2018

Thanks, from the SDK docs if don't see any reference to layers so you're probably correct.

Translate
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 ,
Mar 13, 2018 Mar 13, 2018
LATEST

Yes, the IAC methods don’t have the same support for layers/OCGs that the plugin APIs do

Translate
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