-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkpdfs.php
More file actions
executable file
·35 lines (28 loc) · 857 Bytes
/
Copy pathmkpdfs.php
File metadata and controls
executable file
·35 lines (28 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/php
<?php
/*
* if (!file_exists("themes.json")) {
file_put_contents("themes.json", file_get_contents("https://registry.jsonresume.org/themes"));
}
$themes = json_decode(file_get_contents("themes.json"));
$newthemes = array();
*/
chdir("resumes");
$files = glob("*.html");
$pdf = true;
$html = false;
foreach ($files as $idx=>$file) {
$theme = preg_replace("/\.html/", '', $file);
if ($pdf) {
if (file_exists($theme.".html")) {
$cmd = "wkhtmltopdf --log-level warn --enable-local-file-access -R 0 -L 0 -B 0 -T 0 --page-size Letter --print-media-type " . $theme . ".html ../pdfs/$theme.pdf";
print $cmd."\n";
$results = `$cmd`;
print $results;
} else {
print "*** Error: Resume resumes/$theme.html does not exist.\n";
exit;
}
}
}
?>