You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
diff-pdf
v1.1.0
Action for visually comparing two PDF files using diff-pdf.
By default, This action is successful if there are no differences and failure if the two PDFs differ.
If given the --output-diff
option, it produces a PDF file with visually highlighted differences.
Input PDF file1 path. (required)
Input PDF file2 path. (required)
diff-pdf command options.
[-h] [-v] [-s] [-m] [-g] [--output-diff <str>] [--channel-tolerance <num>] [--dpi <num>]
-h, --help show this help message
-v, --verbose be verbose
-s, --skip-identical only output pages with differences
-m, --mark-differences additionally mark differences on left side
-g, --grayscale only differences will be in color, unchanged parts will show as gray
--output-diff=<str> output differences to given PDF file
--channel-tolerance=<num> consider channel values to be equal if within specified tolerance
--dpi=<num> rasterization resolution (default: 300 dpi)
Note: --view
option is not available.
If set true
, Exit code to 0 even there is a difference.
(Expected to be used with --output-diff
option)
None.
Note: Output following log when running this action. However, don't worry there is no problem.
Unable to init server: Could not connect: Connection refused
01:20:19: Error: Unable to initialize GTK+, is DISPLAY set properly?
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: nowsprinting/diff-pdf-action@v1
with:
file1: expected.pdf
file2: actual.pdf
options: --verbose
# If PDFs do not match, this step will fail.
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: nowsprinting/diff-pdf-action@v1
with:
file1: base.pdf
file2: head.pdf
options: --skip-identical --output-diff=diff.pdf --dpi=100
suppress-diff-error: true
jobs:
diff:
runs-on: ubuntu-latest
container:
image: ghcr.io/nowsprinting/diff-pdf:latest
steps:
- run: diff-pdf "--verbose" expected.pdf actual.pdf
- run: diff-pdf "--skip-identical --output-diff=diff.pdf --dpi=100" base.pdf head.pdf true
MIT License
Open an issue or create a pull request.