电子书阅读器应用程序的问题

发布于 2024-09-09 09:45:22 字数 651 浏览 0 评论 0原文

我正在开发一个电子书阅读器应用程序...我可以像 iBooks 应用程序一样工作。 我已经使用过:

CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("paper.pdf"), NULL, NULL);

pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);

CFRelease(pdfURL);

- (void) renderPageAtIndexNSUInteger)index inContextCGContextRef)ctx 
{
    CGPDFPageRef page = CGPDFDocumentGetPage(pdf, index + 1);
    CGAffineTransform transform = aspectFit(CGPDFPageGetBoxRect(page, kCGPDFMediaBox), CGContextGetClipBoundingBox(ctx));
    CGContextConcatCTM(ctx, transform);
    CGContextDrawPDFPage(ctx, page);
}

但是问题是如何调整字体或文本颜色?我无法找到任何可以更改属性的方法或委托。

请指教。

I am working on a ebook reader application... i can able to work exactly as iBooks application does.
I have used :

CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("paper.pdf"), NULL, NULL);

pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);

CFRelease(pdfURL);

- (void) renderPageAtIndexNSUInteger)index inContextCGContextRef)ctx 
{
    CGPDFPageRef page = CGPDFDocumentGetPage(pdf, index + 1);
    CGAffineTransform transform = aspectFit(CGPDFPageGetBoxRect(page, kCGPDFMediaBox), CGContextGetClipBoundingBox(ctx));
    CGContextConcatCTM(ctx, transform);
    CGContextDrawPDFPage(ctx, page);
}

But the problem how can i adjust font or text color ? I am unable to locate any method or delegate which can change the property.

Please Advice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女猫性小仙女 2024-09-16 09:45:22

您正在加载 PDF 文件。如果不手动从文件中提取文本并重新生成 PDF 或执行您自己的自定义文档绘图,则无法调整该文档中的文本。请注意,iBooks 不允许您更改 PDF 中的字体或文本颜色,而只能放大和缩小文档。

You're loading a PDF file. There's no way to adjust the text in that document without manually extracting the text from the file and either regenerating the PDF or doing your own custom document drawing. Notice that iBooks doesn't let you change the font or text color in a PDF, merely zoom in and out on the document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文