Skip to content
Permalink
Browse files
Fix #174
  • Loading branch information
hhrutter committed May 27, 2020
1 parent ed59dc3 commit 58a1e278d00ee588f6e00b5b74f1fa965c5ce889
Showing 2 changed files with 31 additions and 12 deletions.
@@ -95,7 +95,7 @@ Get the latest binary [here](https://github.com/pdfcpu/pdfcpu/releases).

### Using GOPATH

Required go version for building: go1.13 and up
Required go version for building: go1.14 and up

```
go get github.com/pdfcpu/pdfcpu/cmd/...
@@ -110,15 +110,16 @@ pdfcpu version
git clone https://github.com/pdfcpu/pdfcpu
cd pdfcpu/cmd/pdfcpu
go install
pdfcpu ve
pdfcpu version
```

### Using Homebrew (macOS)
```
brew install pdfcpu
pdfcpu version
```

### Using Docker
### Run in a Docker container

```
docker build -t pdfcpu .
@@ -775,7 +775,11 @@ func SplitFile(inFile, outDir string, span int, conf *pdf.Configuration) error {
log.CLI.Printf("splitting %s to %s/...\n", inFile, outDir)

defer func() {
f.Close()
if err != nil {
f.Close()
return
}
err = f.Close()
}()

return Split(f, outDir, filepath.Base(inFile), span, conf)
@@ -1388,9 +1392,7 @@ func ImportImagesFile(imgFiles []string, outFile string, imp *pdf.Import, conf *
os.Remove(tmpFile)
}
for _, f := range rc {
if err := f.Close(); err != nil {
return
}
f.Close()
}
return
}
@@ -1405,6 +1407,11 @@ func ImportImagesFile(imgFiles []string, outFile string, imp *pdf.Import, conf *
return
}
}
for _, f := range rc {
if err := f.Close(); err != nil {
return
}
}
}()

return ImportImages(rs, f2, rr, imp, conf)
@@ -1651,9 +1658,19 @@ func MergeCreateFile(inFiles []string, outFile string, conf *pdf.Configuration)
return err
}
defer func() {
f.Close()
for _, f := range ff {
if err != nil {
f.Close()
for _, f := range ff {
f.Close()
}
}
if err = f.Close(); err != nil {
return
}
for _, f := range ff {
if err = f.Close(); err != nil {
return
}
}
}()

@@ -1703,7 +1720,6 @@ func MergeAppendFile(inFiles []string, outFile string, conf *pdf.Configuration)
if err != nil {
f2.Close()
if f1 != nil {
f1.Close()
os.Remove(tmpFile)
}
for _, f := range ff {
@@ -1715,10 +1731,12 @@ func MergeAppendFile(inFiles []string, outFile string, conf *pdf.Configuration)
return
}
if f1 != nil {
if err = f1.Close(); err != nil {
if err = os.Rename(tmpFile, outFile); err != nil {
return
}
if err = os.Rename(tmpFile, outFile); err != nil {
}
for _, f := range ff {
if err = f.Close(); err != nil {
return
}
}

0 comments on commit 58a1e27

Please sign in to comment.