fix wrong git ignore
This commit is contained in:
20
internal/pdf/extractor/utils.go
Normal file
20
internal/pdf/extractor/utils.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package extractor
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"gitea.tecamino.com/paadi/pdfmerge/internal/pdf/core"
|
||||
)
|
||||
|
||||
// getNumberAsFloat can retrieve numeric values from PdfObject (both integer/float).
|
||||
func getNumberAsFloat(obj core.PdfObject) (float64, error) {
|
||||
if fObj, ok := obj.(*core.PdfObjectFloat); ok {
|
||||
return float64(*fObj), nil
|
||||
}
|
||||
|
||||
if iObj, ok := obj.(*core.PdfObjectInteger); ok {
|
||||
return float64(*iObj), nil
|
||||
}
|
||||
|
||||
return 0, errors.New("Not a number")
|
||||
}
|
||||
Reference in New Issue
Block a user