feat: use new pdf lib
This commit is contained in:
@@ -4,8 +4,9 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"pdf/lib"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -57,16 +58,28 @@ func main() {
|
||||
Usage: "Debug flag",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description",
|
||||
Usage: "Description for the embedded xml file",
|
||||
Required: false,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "embedded-name",
|
||||
Usage: "Name of the xml file inside the pdf",
|
||||
Required: false,
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
inputPdfFilePath := context.Args().Get(0)
|
||||
inputXmlFilePath := context.String("xml-input")
|
||||
outputFilePath := context.String("out")
|
||||
description := context.String("description")
|
||||
embedName := context.String("embedded-name")
|
||||
debug := context.Bool("debug")
|
||||
|
||||
lib.EnableDebug(debug)
|
||||
|
||||
lib.AppendToPdf(inputPdfFilePath, inputXmlFilePath, outputFilePath)
|
||||
lib.AppendToPdf(inputPdfFilePath, inputXmlFilePath, outputFilePath, embedName, description)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user