pdf解析问题 [英] pdf parsing problem

查看:108
本文介绍了pdf解析问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究pdf viewer。我想提取pdf的所有内容。将cgpdgscanner获取pdf的所有内容??

hi im working on pdf viewer. i want to extract all the contents of the pdf. will cgpdgscanner get all the contents of pdf??

苹果文档非常简短。通过给出的解释很难实现。很多googlin也无处可去。

the apple documentation is very brief. its difficult to implement with the explanations given. and lots of googlin also leads to nowhere.

所以有人可以解释使用目的和使用以下内容:

so can someone explain the use of the purpose and use of the following:

1.CGPDFOperatorTableRef

1.CGPDFOperatorTableRef

2.CGPDFOperatorTableSetCallback

2.CGPDFOperatorTableSetCallback

3.CGPDFScannerRef

3.CGPDFScannerRef

4 .CGPDFContentStreamRef

4.CGPDFContentStreamRef

一旦完成此操作,如何查看解析后获得的数据。

once al this is done how to view the data that is got after parsing.

提前感谢。

推荐答案

CGPDFScanner将解析PDF图形内容流(页面内容或表单XObject内容)。这是非常低级的PDF,您必须知道PDF规范才能解释解析的结果。每次遇到您感兴趣的操作员时,CGPDFScanner都会调用您的方法.CGPDFOperatorTable存储您想要通知的操作员列表。如果要提取所有内容,则必须使用所有PDF图形运算符填充此表。每个运算符与扫描程序在PDF内容流中找到运算符时调用的方法(回调)相关联。
CGPDFScannerRef是PDF扫描程序,CGPDFContentStreamRef是PDF内容流,是与PDF对象关联的流。此流的内容取决于与此流关联的PDF对象。

The CGPDFScanner will parse a PDF graphic content stream (page content or form XObject content). This is very low level PDF, you have to know the PDF specification in order to interpret the results of the parsing. The CGPDFScanner will call a method of yours every time it encounters an operator that you are interested in. The CGPDFOperatorTable stores the list of operators you want to be notified about. If you want to extract all content you have to fill this table with all PDF graphic operators. Each operator is associated with a method (a callback) that is called when the scanner find the operator in the PDF content stream.
The CGPDFScannerRef is the PDF scanner and CGPDFContentStreamRef is a PDF content stream, a stream associated with a PDF object. The content of this stream depends on the PDF object this stream is associated with.

这篇关于pdf解析问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆