Skip to content

Commit

Permalink
Show PDF trailer by default with hexapdf inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
gettalong committed Dec 17, 2016
1 parent 34a4559 commit fc117f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

* Refactor `hexapdf modify` command into three individual commands `modify`,
`merge` and `optimize`
* Show PDF trailer by default with `hexapdf inspect`
* Refactor CLI command classes to use specialized superclass
[HexaPDF::CLI::Command]
* Optimize parsing of PDF files for better performance and memory efficiency
Expand Down
12 changes: 6 additions & 6 deletions lib/hexapdf/cli/inspect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def initialize #:nodoc:
needs to inspect the internal object structure or a stream of a PDF file. A PDF object is
always shown in the PDF syntax.
If no option is given, the main PDF object, the catalog, is shown. Otherwise the various,
mutually exclusive display options define the shown content. If multiple such options are
specified only the last is respected.
If no option is given, the PDF trailer is shown. Otherwise the various, mutually exclusive
display options define the shown content. If multiple such options are specified only the
last is respected.
EOF

options.on("-t", "--trailer", "Show the trailer dictionary.") do
@exec = :trailer
options.on("--catalog", "Show the PDF catalog dictionary.") do
@exec = :catalog
end
options.on("-c", "--page-count", "Print the number of pages.") do
@exec = :page_count
Expand Down Expand Up @@ -88,7 +88,7 @@ def initialize #:nodoc:
end

@password = nil
@exec = :catalog
@exec = :trailer
@param = nil
@raw = nil
end
Expand Down
14 changes: 7 additions & 7 deletions man/man1/hexapdf.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ Synopsis: `inspect` \[`OPTIONS`] *FILE*
This command is useful when one needs to inspect the internal object structure or a stream of a PDF
file.

If no option is given, the main PDF object, the catalog, is shown. Otherwise the various, mutually
exclusive display options define what is shown. If multiple such options are specified only the last
one is respected. Note that PDF objects are always shown in the native PDF syntax.
If no option is given, the PDF trailer is shown. Otherwise the various, mutually exclusive display
options define what is shown. If multiple such options are specified only the last one is respected.
Note that PDF objects are always shown in the native PDF syntax.

`-t`, `--trailer`
`--catalog`

: Show the trailer dictionary.
: Show the PDF catalog dictionary.

`-c`, `--page-count`

Expand Down Expand Up @@ -472,8 +472,8 @@ creator, creation date and encryption related information.
`hexapdf inspect input.pdf -o 3`

Inspect a PDF: These commands can be used to inspect the internal object structure of a PDF file.
The first command shows the PDF catalog object, the main object of a PDF file. The second one shows
the object with the object number 3.
The first command shows the PDF trailer object. The second one shows the object with the object
number 3.


## EXIT STATUS
Expand Down

0 comments on commit fc117f9

Please sign in to comment.