Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicli debug command prompt #10

Open
gunnsth opened this issue Jan 12, 2019 · 0 comments
Open

unicli debug command prompt #10

gunnsth opened this issue Jan 12, 2019 · 0 comments

Comments

@gunnsth
Copy link
Contributor

gunnsth commented Jan 12, 2019

Opens up a prompt for viewing and debugging PDFs. Once in prompt can execute various commands to debug.

$ unicli debug file.pdf
> version
1.7
> pages
10
> page 3
Page context set to page 3
> images
Page 3
1 images
Img1 XObject: 121 0 R
> wo 121 /tmp/img1.dat
Object 121 written to /tmp/img1.dat
> content
q
Img1 Do
Q
> quit
Closing debug prompt
$

Basic commands

version/v - Print PDF version
catalog/c - Displays the PDF catalog
obj/o num - Displays object number `num`   In a readable form.  If the object is binary then avoid writing to the console
writeobj/wo num path - Writes object num to path
pages/pp - number of pages

Page context

It is also possible to work in page context, i.e. set page context to a specific page.

page/p num - Sets page context to page `num`
resources/res (num) - Prints page resources for page num (parameter not needed if page context set)
fonts (num) - Overview of fonts
xobj (num) - Overview of XObjects
contents (num) - Print the contentstream
text - Outputs as text
images - Overview of images in the content

Other

Other things we would like to be able to see:

  • filters: Get an overview of encodings/filters that are used in the PDF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant