forked from buzzert/smartbar
Adds pdfbook command
This commit is contained in:
@@ -89,15 +89,18 @@ func main() {
|
||||
// Load order
|
||||
data, err := os.ReadFile(orderPath)
|
||||
must(err)
|
||||
|
||||
ordered, err := parseYAMLListOfStrings(string(data))
|
||||
must(err)
|
||||
|
||||
// Resolve Chrome
|
||||
chromeExec, err := findChromeExec()
|
||||
must(err)
|
||||
|
||||
opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.ExecPath(chromeExec), chromedp.Flag("headless", true), chromedp.Flag("disable-gpu", true), chromedp.Flag("hide-scrollbars", true))
|
||||
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
||||
defer cancel()
|
||||
|
||||
ctx, cancel := chromedp.NewContext(allocCtx)
|
||||
defer cancel()
|
||||
|
||||
@@ -146,6 +149,7 @@ func main() {
|
||||
|
||||
// Merge PDFs into single output
|
||||
must(os.MkdirAll(filepath.Dir(outPDF), 0o755))
|
||||
|
||||
// pdfcpu expects []string in order and writes outPDF
|
||||
must(pdfapi.MergeCreateFile(partPDFs, outPDF, false, nil))
|
||||
fmt.Printf("Wrote %s (%d pages)\n", outPDF, len(partPDFs))
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
- cover.html
|
||||
- hack-the-planet.html
|
||||
- wtf.html
|
||||
- drivingmissmuni.html
|
||||
- pearlstreetcafe.html
|
||||
- gtkapplang-1.html
|
||||
- gtkapplang-2.html
|
||||
- gtkapplang-3.html
|
||||
- gtkapplang-4.html
|
||||
- drivingmissmuni.html
|
||||
- pearlstreetcafe.html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user