/
PDF Reader crash if PDF file is protected.

PDF Reader crash if PDF file is protected.

KB-20250226-01

Version

Before XFRX 24.3

Symptoms

  • XFRX crash on exception 0xc0000005
  • Was not calls SetPasswords() method

Cause

  • Bug at reading U or O key in ecryption object.

Workaround

m.loPDFR = EVALUATE([xfrx("PDF#READER")])
m.loPDFR.SetPasswords("blablablah","") && set empty user password for pdf file
*m.loPDFR.SetPasswords("blablablah","user_password") && set right user password for pdf file
m.lcFile="BASE-UNI.pdf"
IF m.loPDFR.openDocument(m.lcFile) < 0
RETURN
ENDIF
m.lnError=m.loPDFR.ReadDocument()

m.loPDFR.closeDocument()