GithubHelp home page GithubHelp logo

liuzikai / acrobat-pdf-bookmark-generator Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 46.84 MB

An Adobe Acrobat DC plug-in to generate PDF bookmarks (catalog).

License: MIT License

C++ 35.99% Shell 0.10% Makefile 17.63% C 46.28%

acrobat-pdf-bookmark-generator's Introduction

An Adobe Acrobat DC plug-in to generate PDF bookmarks (catalog) based on given catalog information.

Author: liuzikai
Date: 02/18/2018

Revised based on Adobe Acrobat DC SDK project BasicPlugin.  

Develop and Test Environment:  

  • macOS 10.13.3
  • Adobe Acrobat Pro DC Version 2018.009.20050
  • Xcode Version 9.2

There are some JS scripts on the Internet that have similar function. However, these scripts can only make go-to-page actions with JS code, which is not supported by some PDF readers such as macOS Preview. But using plug-in, native jumping actions can be added to bookmarks.


中文说明

Install

For macOS, Adobe Acrobat DC  

Download BookmarkGenerator.acroplugin.

Copy BookmarkGenerator.acroplugin to /Users/(username)/Library/Application Support/Adobe/Acrobat/DC/Plug-ins.


Usage

1. Prepare a txt file containing catalog infomation.  

Format:

Index Title PageNumber

  Use . to show levels in index.

  Title can contain spaces.

  Index Title will be used as the name of bookmark.

For example:

The plug-in will use the first index level as "basic level", for example:  

Please make sure there is no excess new lines at the end of the txt file.  

If you have catalog pages in the PDF file, you can copy it out (maybe export to other form first) and process the text with some technology such as regular expressions.  


2. Open PDF file in Acrobat and switch to the first page of main body

Since the given page numbers may be different from the actual page number for PDF file, the plug-in need to confirm the first page of main body. For example,

Here is the the first page of main body. However, for PDF file, it is actually page 23.


3. Start the plug-in on menubar Plug-In Tool - Generate Bookmarks...

4. Confirm the first page of main body.

5. Select the catalog txt file.

6. Save the PDF file.


For Developers

This plug-in is developed on macOS and for Acrobat DC. It seems that it can't be directly applied to Win or other version of Acrobat. If you are interested in it, it would be great if you can help developing other versions. :)

Some tips:

  1. Adobe Acrobat DC SDK for Mac is developed based on old Xcode and macOS, so some revisions are needed.
  2. For Acrobat DC, it seems that plug-ins won't be valid if directly put in the application package.
  3. The file MacCopyToPlugins.sh is a script provided by SDK that runs after building. It can perform work such as copying the plug-in to the corresponding folder. In current project, please change the ACROBAT_PLUGINS_FOLDER in Environment.xcconfig to your own path.

Reference

Adobe Acrobat DC SDK for Mac

Acrobat DC SDK Documentation

Acrobat and PDF Library API Reference

在Acrobat中利用Javascript根据目录一键生成带页码的书签

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.