Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
KB-20201125-01
KB-20201125-01
KB-20201125-01

Version

All versions.

Symptoms

If PDF file is PDF/A-2 or PDF/A-3 then veraPDF show error:
"For any character, regardless of its rendering mode, that is mapped to a code or codes in
the U

nicode

the Unicode Private Use Area (PUA),

an ActualText entry as described in ISO 32000-1:2008, 14.9.4

shall be present for this character or a sequence of characters of which such a character is a part."

.

Cause

Space Symbols in text.

XFRX create custom font if PDF/A mode is enable. The first char is "space" with glyph index 0. Rule for  PDF/A-2 or PDF/A-3 don´t allow glyph index 0, because it's index for not defined glyph.

Workaround

Use hack classdirective:

Code Block
loHACK=CREATEOBJECT("_XFRXHACK", loSession)
loSession.ProcessReport("somereport.frx")
RELEASE loHACK

DEFINE CLASS _XFRXHACK AS CUSTOM
   oEWriter=.NULL.

   PROCEDURE Destroy
      UNBINDEVENTS(This.oEWriter.oPDF)
   ENDPROC
   
   PROCEDURE Init(m.loSession)
      m.loSession=IIF(TYPE("m.loSession.oxfSession")="O",m.loSession.oxfSession,m.loSession)
      =BINDEVENT(m.loSession.oDocumentWriter.oPDF,"setPDFA",This,"setPDFA", 1)
      This.oEWriter=m.loSession.oDocumentWriter
   ENDPROC
 
   PROCEDURE setPDFA
      LPARAMETERS m.tlPDFA, m.tcPDFA
      This.oEWriter.oPDF.lUseUnicodeMapping=.F.
   ENDPROC
 
 ENDDEFINE#UR TEXTTOIMAGE=.T.