Skip to content

v0.3.0: Wire protocol update, OSX support

Compare
Choose a tag to compare
@pwaller pwaller released this 07 Jul 13:29
  • Add --meta-only command line option
  • Add --bitmap option
  • Add --font-info option
  • Add support for OSX and homebrew formula
  • Include path style information (stroke width/color, fill color)

The wire protocol has changed to allow it to be more extensible.

The page is now a dictionary, allowing it to be extended with further detail
in the future, and conditionally contain objects.

If --bitmap is specified, page contains a "Bitmap" key.

New wire protocol:

document (consecutive objects): <wire version : int> <metadata> <page>...

metadata (dict): {
  "Pages": int,
  "FileName": str,
  "FontInfo": [<fontinfo : dict>...],
  (other string fields supplied in PDF),
}

page (dict): {
  "Size": [<width : int>, <height : int>],
  "Glyphs": [<glyph>...],
  "Paths": [<pathitem>...],
}

pathitem (list): [<type : (EO_FILL|STROKE|FILL|SET_STROKE_COLOR|
                           SET_STROKE_WIDTH|SET_FILL_COLOR)>,
                  [<pathdata>...]]

pathdata (list): depending on pathitem type
  EO_FILL, FILL, STROKE: pathcoord
  SET_FILL_COLOR: [<r : uint8>, <g : uint8>, <b : uint8>]
  SET_STROKE_WIDTH: <width : float>

pathcoord (2 list or 6 list):
  point: [<x : float>, <y : float>]
  quadratic curve: [<a : float>, <b : float>, <c : float>, <d : float>, <e : float>, <f : float>] 

fontinfo (dict): {<Name> <Type> <Encoding> <Embedded> <Subset> <ToUnicode>}

SHA256

ebc9e2c44df687629d16edd417372021954f75bfae0757e5507bf447b70dd186  pdf2msgpack
86c882185551e2e03796a4daded103936c4960b4e06460ebcec006f07dad7b08  pdf2msgpack.dbg