unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.56k stars 251 forks source link

[BUG] NewImageFromData and ApplyStandard #470

Closed polderudo closed 2 years ago

polderudo commented 3 years ago

Description

Adding a Image to a creator and applying a Standard (like PDFa1) throws an error

Expected Behavior

Added images should be of imageutil.RGBA so a standard can be applyed.

Actual Behavior

Steps to reproduce the behavior:

cc := creator.New()
cc.SetPdfWriterAccessFunc(func(w *model.PdfWriter) error {
  w.ApplyStandard(pdfa.NewProfile1A(nil))
  return nil
})
img, err := cc.NewImageFromData(signSrc)
cc.Draw(img)
cc.WriteToFile() //throws error: interface conversion: *imageutil.NRGBA32 is not imageutil.RGBA: missing method RGBAAt
gunnsth commented 2 years ago

This has been fixed in latest versions.