123456789101112131415161718192021222324252627282930313233343536 |
- //
- // CPDFViewController.m
- // PDFViewer
- //
- // Created by kdan on 2022/11/15.
- //
- #import <ComPDFKit/ComPDFKit.h>
- #import "CPDFViewController.h"
- @interface CPDFViewController ()
- @end
- @implementation CPDFViewController
- - (instancetype)initWithPath:(NSString *)inPath {
- if (self = [super init]) {
- _path = inPath;
- }
- return self;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- NSURL *url = [NSURL fileURLWithPath:_path];
- CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url];
- CPDFView *pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
- pdfView.document = document;
- pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- [self.view addSubview:pdfView];
- }
- @end
|