diff --git a/pdf/extractor/utils.go b/pdf/extractor/utils.go index 8edb51f4..a8b8978c 100644 --- a/pdf/extractor/utils.go +++ b/pdf/extractor/utils.go @@ -11,7 +11,7 @@ import ( "github.com/unidoc/unidoc/common" "github.com/unidoc/unidoc/common/license" - . "github.com/unidoc/unidoc/pdf/core" + "github.com/unidoc/unidoc/pdf/core" "github.com/unidoc/unidoc/pdf/model" ) @@ -36,7 +36,7 @@ func procBuf(buf *bytes.Buffer) { } // toFloatList returns `objs` as 2 floats, if that's what it is, or an error if it isn't -func toFloatXY(objs []PdfObject) (x, y float64, err error) { +func toFloatXY(objs []core.PdfObject) (x, y float64, err error) { if len(objs) != 2 { err = fmt.Errorf("Invalid number of params: %d", len(objs)) common.Log.Debug("toFloatXY: err=%v", err) diff --git a/pdf/model/font_test.go b/pdf/model/font_test.go index 3a4ad9f7..85c77fcb 100644 --- a/pdf/model/font_test.go +++ b/pdf/model/font_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/unidoc/unidoc/common" - . "github.com/unidoc/unidoc/pdf/core" + "github.com/unidoc/unidoc/pdf/core" "github.com/unidoc/unidoc/pdf/model" "github.com/unidoc/unidoc/pdf/model/fonts" ) @@ -142,7 +142,7 @@ func TestCompositeFonts(t *testing.T) { // the new PDF object is the same as the input object func objFontObj(t *testing.T, fontDict string) error { - parser := NewParserFromString(fontDict) + parser := core.NewParserFromString(fontDict) obj, err := parser.ParseDict() if err != nil { t.Errorf("objFontObj: Failed to parse dict obj. fontDict=%q err=%v", fontDict, err) @@ -155,11 +155,11 @@ func objFontObj(t *testing.T, fontDict string) error { } // Resolve all the indirect references in the font objects so we can compare their contents. - obj1 := FlattenObject(obj) - obj2 := FlattenObject(font.ToPdfObject()) + obj1 := core.FlattenObject(obj) + obj2 := core.FlattenObject(font.ToPdfObject()) // Check that the reconstituted font is the same as the original. - if !EqualObjects(obj1, obj2) { + if !core.EqualObjects(obj1, obj2) { t.Errorf("Different objects.\nobj1=%s\nobj2=%s\nfont=%s", obj1, obj2, font) return errors.New("different objects") } diff --git a/pdf/model/textencoding/identity.go b/pdf/model/textencoding/identity.go index 1e7332b3..e62237ed 100644 --- a/pdf/model/textencoding/identity.go +++ b/pdf/model/textencoding/identity.go @@ -10,7 +10,7 @@ import ( "fmt" "github.com/unidoc/unidoc/common" - . "github.com/unidoc/unidoc/pdf/core" + "github.com/unidoc/unidoc/pdf/core" ) // IdentityEncoder represents an 2-byte identity encoding @@ -113,9 +113,9 @@ func (enc IdentityEncoder) GlyphToRune(glyph string) (rune, bool) { } // ToPdfObject returns a nil as it is not truly a PDF object and should not be attempted to store in file. -func (enc IdentityEncoder) ToPdfObject() PdfObject { +func (enc IdentityEncoder) ToPdfObject() core.PdfObject { if enc.baseName != "" { - return MakeName(enc.baseName) + return core.MakeName(enc.baseName) } - return MakeNull() + return core.MakeNull() }