F::pdf2json;
# ABSTRACT: helper module to retrieve data from pdf2json
$PDF::pdf2json::VERSION = '0.002';
use strict;
use warnings;
use File::Temp;
use Path::Class;
use Alien::pdf2json;
use JSON::Mayb
eXS;
our $alien = Alien::pdf2json->new;
sub pdf2json {
my ($self, $pdf, %param) = @_;
$param{quiet} //= 1;
my $temp_fh = File::Temp->new ( UNLINK => 0 );
my @args = ();
if( exists $param{page}
$alien->pdf2json_path,
'-enc', 'UTF-8',
@args,
$pdf,
$temp_fh->filename,
];
my $ret = system( @$cmd );
die "pdf2json failed" if $ret;
# read data from temp file
my $json_data = file(