如何在我的应用中嵌入pdf?我应该将pdf文件网址传递给网络视图并让它处理它还是有更好的方法/
干杯
瓦特://
答案 0 :(得分:1)
CGContext context = UIGraphics.GetCurrentContext();
context.SaveState();
CGPDFDocument pdfDoc = CGPDFDocument.FromUrl(_pdfFileUrl);
if(pdfDoc.Pages >= 1)
{
CGPDFPage pdfPage = pdfDoc.GetPage(1);
context.ScaleCTM(SCALE.Width, SCALE.Height);
// the PDFRectangle is the media box rect of the page, which is hardcoded
// for now
context.TranslateCTM(-this.PDFRectangle.X, -this.PDFRectangle.Height - this.PDFRectangle.Y);
context.DrawPDFPage(pdfPage);
}
pdfDoc.Dispose();
context.RestoreState();
从这里开始:
MonoTouch CoreGraphics PDF memory issues with CGPDFDocument and CGPDFPage
这是一个关于内存泄漏的问题,但在此过程中回答了我的问题。
瓦特://
答案 1 :(得分:0)
您可能想看看UIDocumentInteractionController,它允许查看各种文件格式。