私は現在ココアに取り組んでいるので、Macの開発には少し慣れていません。
サーバーからPDFを開きたい。これはで可能PDFViewですか?
誰かがこれで私を導くならば、それは私にとって非常に役に立ちます。
PDFViewでPDFファイルを開くためのサンプルコードはありますか?
前もって感謝します..!!!
答えが出ました。
少なくとも私のために働いています..:)
NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"1.pdf" ofType:nil];
NSURL *url = [NSURL fileURLWithPath:urlStr];
PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:url];
[pdfView setDocument:pdfDoc];
Swiftバージョン(Quartzモジュールをインポートすることを忘れないでください)
guard let docPath = NSBundle.mainBundle().pathForResource("1", ofType: "pdf") else { return }
let docURL = NSURL.fileURLWithPath(docPath)
let pdfDocument = PDFDocument(URL: docURL)
Swift3.0バージョン:)
guard let docPath = Bundle.main.path(forResource: "1", ofType: "pdf") else { return }
let docURL = NSURL.fileURL(withPath: docPath)
let pdfDocument = PDFDocument(url: docURL)
uxPdf.document = pdfDocument