0

I'm using CGPDFScannerto scan PDF. When the scanner encounters something like:

BT
/F13 12 Tf 288 720 Td (ABC) Tj
ET

I use operator callbacks to extract the Tf, Td and Tj data. How do I extract /F13?

Ken
  • 30,811
  • 34
  • 116
  • 155

1 Answers1

1

It's a name, a special form of string, usually used as dictionary keys. You can pop it with CGPDFScannerPopName. The information about the actual font is contained in the page's Resources dictionary, which contains a Font dictionary.

omz
  • 53,243
  • 5
  • 129
  • 141
  • So the font name that's popped in the `Tf` callback is a key to a value in the font dictionary (itself a value in the page resource dictionary)? – Ken May 18 '11 at 00:45
  • Yes. Be sure to read the [PDF specification](http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf) for details. Fonts in PDF are a pretty complex topic. – omz May 18 '11 at 00:56