Tag: pdf

适用于Android的PDF地图覆盖

我正在研究一个基于BLE Beacons的室内本地化应用程序,在这个应用程序中需要将人员的位置绘制到底板上。 在iOS上,我发现可以在这里find的足迹示例: https : //developer.apple.com/library/ios/samplecode/footprint/Introduction/Intro.html 它利用苹果地图工具包和PDF地图以及一些帮助类来在MapView上缩放和绘制覆盖图,这看起来工作正常,正是我所需要的。 不幸的是,我无法find类似的android的东西。 问题是:有没有人find类似的示例项目,文档或Android的简单框架来处理这个任务? 样本,文件或框架应包括在Google地图上绘制和alignmentPDF,包括pdfPoint到纬度/经度转换。

如何将PDF转换为NSImage并更改DPI?

我试图将PDF页面转换成NSImage并成功保存到JPG文件。 但是输出结果是正常的72 DPI。 我想将DPI更改为300 DPI但失败。 以下是代码: – (IBAction)TestButton:(id)sender { NSString* localDocuments = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) objectAtIndex:0]; NSString* pdfPath = [localDocuments stringByAppendingPathComponent:@"1.pdf"]; NSData *pdfData = [NSData dataWithContentsOfFile:pdfPath]; NSPDFImageRep *pdfImg = [NSPDFImageRep imageRepWithData:pdfData]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSInteger pageCount = [pdfImg pageCount]; for(int i = 0 ; i < pageCount ; i++) { [pdfImg setCurrentPage:i]; NSImage *temp […]

从PDF文件中searchstring/文本,并在iPhone / iPad应用程序中列出所有匹配的string

我已经实现了一个iPad应用程序,它实际上是读取PDF文件(使用石英)。 现在我想实现searchfunction,为此,我已经检查了一些教程,其中提到使用石英和一些提到FastPdfKit。 但是我不知道哪一个会更好。 我已经看到石英( https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf_scan/dq_pdf_scan.html )。 我对此有一些疑问。 “运营商callback”是什么,为什么我们使用这个? “运营商表”这个目的是什么? 和 我们将在哪里放置search文本。 请在这方面给我build议,或提供我可以使用的任何其他开源。 提前致谢。

生成PDF时不显示NSAttributedString

这曾经工作,现在,突然间,它停止工作: 对于iOS 7 iPad应用程序,我生成一个PDF UIGraphicsBeginPDFContextToFile(pdfPathWithFileName, CGRectZero, nil); … UIGraphicsEndPDFContext(); 在那个代码块中,下面的方法用于渲染文本下划线,但是最近,它只是停止工作,传递给方法的任何文本都不会被渲染: +(void)drawUnderlinedText:(NSString *)text withFont:(UIFont *)font andColor:(UIColor *)color andLocationX:(int)locationX andLocationY:(int)locationY andTextAreaWidth:(int)textWidth andTextAreaHeight:(int)textHeight{ NSDictionary *attributesDict; NSMutableAttributedString *attString; attributesDict = @{NSForegroundColorAttributeName : color, NSFontAttributeName : font, NSUnderlineStyleAttributeName : [NSNumber numberWithInt:NSUnderlineStyleSingle]}; attString = [[NSMutableAttributedString alloc] initWithString:text attributes:attributesDict]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, color.CGColor); CGRect rect = CGRectMake(locationX, locationY, textWidth, textHeight); […]

将shinobi图表打印成PDF

我在我的应用程序中有几个shinobicharts,我想打印成PDF文件。 其他一切,如正常的意见,标签和图像工作正常,甚至网格,图例和网格标签显示。 唯一缺less的是这个系列。 所以基本上我得到一个空的图表打印到PDF文件。 我打印PDF如下: NSMutableData * pdfData=[NSMutableData data]; PDFPage1ViewController *pdf1 = [self.storyboard instantiateViewControllerWithIdentifier:@"PDF1"]; pdf1.array1 = array1; pdf1.array2 = array2; pdf1.array3 = array3; pdf1.array4 = array4; UIGraphicsBeginPDFContextToData(pdfData, CGRectZero,nil); CGContextRef pdfContext=UIGraphicsGetCurrentContext(); UIGraphicsBeginPDFPage(); [pdf1.view.layer renderInContext:pdfContext]; UIGraphicsEndPDFContext(); 从PDF1PageViewController完全相同的代码在一个普通的viewController绘制漂亮的图表,不会错过系列。 数组包含应该显示的数据。 [编辑] 这段代码为我做了: UIGraphicsBeginImageContextWithOptions(pdf1.view.bounds.size, NO, 0.0); [pdf1.view drawViewHierarchyInRect:pdf1.view.bounds afterScreenUpdates:YES]; UIImage *pdf1Image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageView *pdf1ImageView = [[UIImageView alloc] initWithImage:pdf1Image]; […]

MonoTouch:如何按照苹果幻灯片“build立报刊应用程序”(Session 504)中的说明逐步下载PDF?

这是一个后续: MonoTouch:如何保存一个庞大的PDF从URL递增? 我试图按照报亭演示文稿(“build设报刊应用”,Session 504)的Apple幻灯片指示的指导方针: http://adcdownload.apple.com//wwdc_2011/adc_on_itunes__wwdc11_sessions__pdf/504_building_newsstand_apps.pdf Applebuild议使用NSURLConnection Delegate和NKAssetDownload来下载和恢复报亭内容,但我不明白MonoTouch中的C#代码与幻灯片中显示的Obj-C中的相同。 问题是如何从我的MonoTouch iPhone / iPad报亭应用程序中的URL下载一个巨大的PDF文件,这个PDF通常太大而不适合内存。 要按照幻灯片中的说明逐步执行下载,而不是将所有下载的数据附加到NSData中,并在下载的最后,并在获取所有数据时将其存储到文件中,则需要单独执行下载线程并追加到一个文件,每个接收块和释放我的记忆。 同时,我需要确定的是,如果连接断开或应用程序崩溃,下载将自动从最后一个块中恢复,而不会损坏文件。 在MonoTouch中处理这个问题有什么更好的办法,而不会冒着看到苹果拒绝我的应用程序的风险? 提前致谢!

WKWebView保存pdf到ibooks,从链接保存pdf

我是Junior,目前正在从事WKWebView中Im的项目工作,并且有打开pdf的链接。 我可以在Safari中打开它,然后在iBooks中打开,但我希望它在我的应用程序内部执行。 可能吗 ? 这里是图片如何看起来像: 图片,我可以selectpdf 图片会打开什么 我的webview类 class WebVC: UIViewController, WKUIDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let myURL = NSURL(string: "\(savedURL!)") let myRequest = URLRequest(url: myURL! as URL) webView.load(myRequest) webView.allowsBackForwardNavigationGestures = true webView.allowsLinkPreview = false } override func viewWillAppear(_ animated: Bool) { self.navigationController?.toolbar.isHidden = false } override func loadView() { […]

如何在本地保存PDF或其他文件在iOS中

我正在开发function来读取PDF并在iPhone和iPad本地保存。 我build立这个到iOS 6.1和更多,所以我没有任何约束的SDK。 所以,我想知道什么是最好的和简单的解决scheme来写本地内容(无论文件)。 也许有人知道一个lib做这个function?

pdf图像颜色空间麻烦ios

编辑我一直在使用的PDF文件显然是在“indesign”格式(不pipe这意味着什么),因此没有颜色configuration文件,有谁知道我怎么可以添加configuration文件,如果有可能呢? 编辑结束 提前感谢任何人都可以借此解决这个问题。 首先让我告诉你,我是一种新的开发IOS,我想在Xcode上使用石英的pdf阅读器,一切工作正常,除了图像的渲染,由于某种原因,颜色空间是完全的弄乱。 请看看这个例子。 这是我在我的IOS设备上得到的图像: 这是它看起来如此: 作为参考,绘制PDF页面的代码部分如下: – (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context { ReaderContentPage *readerContentPage = self; // Retain self CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // Fill CGContextTranslateCTM(context, 0.0f, self.bounds.size.height); CGContextScaleCTM(context, 1.0f, -1.0f); CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(_PDFPageRef, kCGPDFCropBox, self.bounds, 0, true)); //CGContextSetRenderingIntent(context, kCGRenderingIntentDefault); CGContextSetInterpolationQuality(context, kCGInterpolationDefault); CGContextDrawPDFPage(context, _PDFPageRef); // Render the PDF page into […]

如何加载UIWebview中心的PDF文件

我在ios开发中是新的。我试图在UIWebview中心显示一个pdf。我有一个PDF在mainbundle.Here是我的PDF看起来像现在加载在一个UIWebView:(我把棕色渐变为UIWebView的背景,所以你可以看到我的意思更好)。 – (void)viewDidLoad { UIWebView *theWebView = [[UIWebView alloc] initWithFrame:[self.view bounds]]; [theWebView setContentMode:UIViewContentModeScaleAspectFit]; [theWebView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; [theWebView setScalesPageToFit:YES]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"]; NSURL *filePathURL = [NSURL fileURLWithPath:filePath]; [theWebView loadRequest:[NSURLRequest requestWithURL:filePathURL]]; [self.view addSubview:theWebView]; [super viewDidLoad]; } 我想以此为中心,使底部边距与顶部边距相同。 我如何用PDF(本地)来做到这一点?