Browse Source

set primary page

master
Pascal Gloor 5 years ago
parent
commit
66ce1896bd
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      bin/autodoc_process.pl

+ 7
- 0
bin/autodoc_process.pl View File

my $originaldir = $conf->{path}{global}.'/'.$conf->{path}{original}; my $originaldir = $conf->{path}{global}.'/'.$conf->{path}{original};


my %langid; my %langid;
my %primary;
my $q = sqlquery($dbh, "SELECT id,short FROM lang"); my $q = sqlquery($dbh, "SELECT id,short FROM lang");
while(my($id,$short)=$q->fetchrow_array()) { $langid{$short}=$id; } while(my($id,$short)=$q->fetchrow_array()) { $langid{$short}=$id; }


print "new page id $pageid\n"; print "new page id $pageid\n";
update_page_status($pageid, 'inprogress'); update_page_status($pageid, 'inprogress');


if ( !exists $primary{$docid} ) {
$primary{$docid}=undef;
sqlquery($dbh, "CALL set_primary_page(?)",$pageid);
}


print "create original page jpeg $pageid.jpeg"; print "create original page jpeg $pageid.jpeg";
system(sprintf("pdftoppm -f %s -l %s -r 300 -jpeg -singlefile %s/%s %s/%s", $page+1, $page+1, $queuedir, $file, $originaldir, $pageid)); system(sprintf("pdftoppm -f %s -l %s -r 300 -jpeg -singlefile %s/%s %s/%s", $page+1, $page+1, $queuedir, $file, $originaldir, $pageid));
system(sprintf("mv %s/%s.jpg %s/%s.jpeg", system(sprintf("mv %s/%s.jpg %s/%s.jpeg",

Loading…
Cancel
Save