cgpdf

Create Multi-Page PDF from other PDFs

旧时模样 提交于 2020-01-17 00:47:09
问题 I've previously posted a related question on SO, but to no avail. I then changed my approach and created PDFs which all have the exact same dimensions, etc. All these PDFs also consists of one page only. Now I would like to combine these single page PDFs into one multi-page PDF. From here I think I've figured what the steps are in creating the multi-page PDF. After running the code below, a PDF with the expected file name is created, but the PDF consists of only one page, and it is entirely

CGPDFScannerPopString returning strange result

前提是你 提交于 2020-01-06 08:11:54
问题 I finally got some sort of pdf scanner to work. It reads into the callback functions without a problem, but when I try to NSLog the result from a CGPDFScannerPopString I get a result like this: ˆ ˛˝ # ˜˜˜ #˜' ˜˜˜ "˜ '˜˜ " ' ˜˜ No string to be found here... Any ideas of what it can be? This is my callback function: static void op_Tj (CGPDFScannerRef s, void *info) { CGPDFStringRef string; if (!CGPDFScannerPopString(s, &string)) return; NSLog(@"string: %@", (__bridge NSString *

UIGraphicsBeginPDFPage() randomly crashes on 64bit devices (CGPDFSecurityManagerCreateDecryptor ())

故事扮演 提交于 2019-12-22 06:02:44
问题 I'm struggling with a pdf export method that's was running just fine until I ported the app to the arm64 achitecture. Bacisally, the method opens an existing PDF, it creates a new pdf file, and draws the content of the first pdf into the newly created one before adding more content pages. When the method tries to create a new pdf page to the document (after the first pdf was integrated to the new pdf) the app crashes with a EXC_BAD_ACCESS warning on UIGraphicsBeginPDFPage(); call . It only

iOS PDF to plain text parser

自古美人都是妖i 提交于 2019-12-12 10:14:04
问题 I'm quite at a lost on this subject. I've read pretty much every post about it here on SO, I would very much appreciate it if somebody would nudge me in the right direction. I have a PDF and I would like to extract it's text, I'm only interested in words and spaces. I have setup a CGPDFScanner and it's callback methods. What I have read is that I only need to consider 4 operators TJ, Tj, qout(') and doubleqout(") as far as extracting text goes. I guess I also need to keep track of the text

iOS CGPdf highlight text using CGrect

折月煮酒 提交于 2019-12-11 21:15:59
问题 I am trying to highlight text using rect but the code below: CGRect originalSize = CGPDFPageGetBoxRect(pagePDFRef, kCGPDFMediaBox); return me rect less then I expected or maybe less then I see. Is there any already made method that highlight text using scanner and CGRect 来源: https://stackoverflow.com/questions/23920377/ios-cgpdf-highlight-text-using-cgrect

iOS PDF to plain text parser

风格不统一 提交于 2019-12-06 15:42:48
I'm quite at a lost on this subject. I've read pretty much every post about it here on SO, I would very much appreciate it if somebody would nudge me in the right direction. I have a PDF and I would like to extract it's text, I'm only interested in words and spaces. I have setup a CGPDFScanner and it's callback methods. What I have read is that I only need to consider 4 operators TJ, Tj, qout(') and doubleqout(") as far as extracting text goes. I guess I also need to keep track of the text space to be able to determine whether the letters should be put together to form a word or should be

UIGraphicsBeginPDFPage() randomly crashes on 64bit devices (CGPDFSecurityManagerCreateDecryptor ())

狂风中的少年 提交于 2019-12-05 10:39:35
I'm struggling with a pdf export method that's was running just fine until I ported the app to the arm64 achitecture. Bacisally, the method opens an existing PDF, it creates a new pdf file, and draws the content of the first pdf into the newly created one before adding more content pages. When the method tries to create a new pdf page to the document (after the first pdf was integrated to the new pdf) the app crashes with a EXC_BAD_ACCESS warning on UIGraphicsBeginPDFPage(); call . It only happens with some PDF files, not all and only on 64 bit devices. Here's the stacktrace which shows the

Merge 2 pdf files in iOS

为君一笑 提交于 2019-12-01 05:53:05
I am trying to merge two PDF files in iOS. I am merging page-by-page. It takes a lot of time in case of very big files. Is there any way, we can just merge the two files, instead of page-by-page ? I can post my code , if you want. My code is similat to the one Here on SO Try this code..It adds up 1st pdf file then at the of that it,it adds 2nd pdf file to make single pdf. NSString *cacheDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; // File paths NSString *pdfPath1 = [[NSBundle mainBundle] pathForResource:@"pdf1" ofType:@"pdf"]; NSString

Merge 2 pdf files in iOS

感情迁移 提交于 2019-12-01 03:44:01
问题 I am trying to merge two PDF files in iOS. I am merging page-by-page. It takes a lot of time in case of very big files. Is there any way, we can just merge the two files, instead of page-by-page ? I can post my code , if you want. My code is similat to the one Here on SO 回答1: Try this code..It adds up 1st pdf file then at the of that it,it adds 2nd pdf file to make single pdf. NSString *cacheDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; //