Solved! Go to Solution.
If I were you I'd take a look at TileMill and the mbtiles format instead of TPK. TileMill is free and much easier to use to create tiles, and its not hard to write your own tiled layer and tile operation to get the tiles from the mbtiles file.