1

I'm parsing a PDF file and it seems that a Tf operator is missing. I can see, on PDF readers like Acrobat reader or Preview, that the font changes. But during the parse I don't have the Tf operator. I still have the ET operator that marks the ending of the previous text block and BT operator for the beginning of the new one. I also have text showing operator Tj & co.

Just to be clear, I do have Tf operators, but just in one place it should be there, it isn't.

The PDF reference states :

There is no initial value for either font or size; they must be specified explicitly by using Tf before any text is shown.

I don't understand why if I don't have Tf operator, how those readers can render the text correctly ?

Does someone know where the problem could come from ?

bob
  • 382
  • 2
  • 17
  • 1
    Please share the PDF in question (or at least the content stream you are talking about). Furthermore, please be aware that PDF viewers have a tendency to try and display even invalid PDFs; in doing so they have to go beyond the specification. Probably you are running into such a situation. – mkl Feb 18 '16 at 16:18
  • @mkl I was wondering that too. I can't share the pdf or the logs because I'm not allowed to do so. Anyway, thank you for your suggestion. – bob Feb 19 '16 at 10:52

1 Answers1

1

AFAIK text state is part of graphics state so if you have a Q operator somewhere there then that would explain the font changing (it would restore the state saved by previous q operator).

Also, the graphics state operator gs could cause the change of font.

ain
  • 22,394
  • 3
  • 54
  • 74