MyNixOS website logo
Description

Name a PDF file using information from the pdfinfo command.

The pdfname command-line program names a PDF file using the author, year of creation and title information extracted from the pdfinfo program.

pdfname Hackage version

Description

The pdfname command-line program names a PDF file using the author, year of creation and title information extracted from the pdfinfo program.

Prerequisites

Installation

The program can installed with the following commands:

$ cabal update
$ cabal install pdfname

Usage

Just run pdfname on your PDF file.

How is the FileName Chosen?

Given the author, year of creation and title information extracted from the pdfinfo program (fields Author, CreationDate and Title, respectively) the name of the PDF file will be

author-year.title.pdf

where author and title are the strings obtained after making certain substitutions (e.g. remove whitespace, translate non-ASCCI characters and remove TeX/LaTeX specific information) to the information shown by the pdfinfo program.

Example. Let's suppose that running pdfinfo on the file foo.pdf shows the following (fictional and incomplete) information:

$ pdfinfo foo.pdf
Title:          Introducction to the <TEX>$\lambda$</TEX>-Calculus
Author:         Per Martin-Löf
CreationDate:   Fri Apr  9 07:14:01 2010

Now, running pdfname on that file will create the new file

/tmp/martin-lof-2010.introduction-to-the-lambda-calculus.pdf

Bug Reporting

Use the bug tracker for reporting bugs.

If your bug includes a PDF file it is not necessary to disclose nor to attach the file. All that it is necessary is the minimal PDF metadata required for triggering the bug. There are various GUI, online and command-line tools for modifying the PDF metadata.

Known Errors

If a PDF file or its metadata information is damaged pdfname (via the pdfinfo library) generates an error. Known errors are the followings:

fd:5: hGetContents: invalid argument (invalid byte sequence)
Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

If you get a different error message, please report it.

Metadata

Version

0.3

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows