Skip to content

v1.2.0

Latest

Choose a tag to compare

@SudoStar SudoStar released this 11 Oct 19:05
76a407b

gopdfrab 1.2.0 makes conversion more honest and the CLI easier to read. No
public Go symbol changed. Convert now rasterizes fewer pages, reports what it
could not draw, and produces fewer files that other validators reject. The
CLI's text output is grouped and has a fixed, parseable layout.

Highlights

  • No more silent gray boxes: a JPEG 2000 or JBIG2 image, or a CCITT image
    that fails to decode, was painted as a gray placeholder on a rasterized page
    and reported nowhere. It is now listed in RasterDrops, and fixers no longer
    write the gray into the file in place of the picture.
  • The CLI reports rasterization: convert prints rasterized: and
    dropped: lines (rasterizedPages and rasterDrops in --json). Before,
    a page rebuilt as an image with content missing printed only
    result: conformant.
  • Grouped, parseable CLI output: one line per check and message, with a
    count, page ranges and the number of objects, and the profile named once in
    a header. --detail lists every location. The layout is documented in the
    README.
  • Fewer rasterized pages: graphics state nested past the 28-level limit,
    tiling patterns in an uncovered device colour space, array-form LZW filters
    on inline images and CID fonts that draw an unmapped glyphless CID are now
    repaired in place.
  • More accurate font checks (6.3.5/6.3.6): fonts are tracked across q/Q
    and into form XObjects, simple TrueType codes resolve through /Encoding and
    the cmaps as ISO 32000-1 specifies, and Type 1 subsets are checked against
    their built-in encoding and hexadecimal /CharSet. This removes false
    reports and catches missed ones.
  • Output other validators accept: converted files that veraPDF or BFO
    rejected because of CFF and Type 1 width encodings, a missing glyph for code
    160, truncated empty TrueType glyphs or wrong sfnt checksums now pass.

Behaviour changes

  • CLI text output: verify and convert print a new, grouped layout.
    Scripts that parse the old per-issue lines need updating, or can switch to
    --json, which keeps its existing fields and gains rasterizedPages and
    rasterDrops.
  • Unsupported levels are an error: a profile whose level is not A1B or
    ObjectModel, such as NewProfile("A-2b") or a zero-value Profile, ran
    no checks and verified as Valid. Verify and Convert now return an error
    for it.
  • PDFError.String prints an object as ref 4 0 R instead of
    ref &{4 0}.
  • Crafted encryption dictionaries with an inconsistent /V and /R
    return ErrEncrypted instead of ErrInternal.

The last three make results more correct, which the stability policy treats
as fixes.

Install

go get github.com/voidrab/gopdfrab@v1.2.0
go install github.com/voidrab/gopdfrab/cmd/gopdfrab@v1.2.0

Or download a CLI binary below. They are static, built with CGO_ENABLED=0;
verify with sha256sum -c checksums.txt.

The full list of additions, changes and fixes is in
CHANGELOG.md.