Create a table of contents from a pdf file

前端 未结 4 938
不思量自难忘°
不思量自难忘° 2020-12-02 18:02

I\'m using quartz to display pdf content, and I need to create a table of contents to navigate through the pdf. From reading Apple\'s documentation I think I am supposed to

4条回答
  •  既然无缘
    2020-12-02 18:37

    Here is my approach.
    1. Download this framework vfr reader
    2. Use this lines of code to get all PDF chapters

    NSString *path = [[NSBundle mainBundle] pathForResource:@"Reader" ofType:@"pdf"];
    NSURL *targetURL = [NSURL fileURLWithPath:path];
    NSArray *arr = [ReaderDocumentOutline outlineFromFileURL:targetURL password:@""];
    

    Hope it will help you.

提交回复
热议问题