gpt4 book ai didi

macos - 如何在cocoa应用程序中使用PDFView?

转载 作者:行者123 更新时间:2023-12-03 16:50:12 24 4
gpt4 key购买 nike

我现在正在研究 cocoa,所以对 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];

关于macos - 如何在cocoa应用程序中使用PDFView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7978498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com