Extracted image has right size but looks weird.

KB-20231201-01

Version

Before XFRX 22.6

Symptoms

Extracted image looks weird or is empty.

Cause

Alpha layer defined in PDF file use inverted values.

Workaround

 Use hack which drop flag of alpha layer.

LOCAL m.loPDFR, m.lnError, m.liCount, m.lcFilePDF
LOCAL ARRAY m,laImgs(1)
m.lcFilePDF="some.pdf"

m.loPDFR = Evaluate([xfrx("PDF#READER")])
If loPDFR.openDocument(m.lcFilePDF) < 0
   Return ""
Endif

m.lnError = m.loPDFR.ReadDocument()
m.liCount = m.loPDFR.GetListImages(-1, @laImgs)

* drop flag of alpha layer for all images
REPLACE SMASKID WITH 0 FOR SMASKID>0 IN  (m.loPDFR.cImages)

m.loPDFR.SaveImages(@laIMGS, m.lcFilePDF+"_pic")
loPDFR.closeDocument()