Questions tagged [cgpdfdocument]

cgpdfdocument is part of Apple's Core Graphics framework. It specifically refers to a document that contains PDF (Portable Document Format) drawing information used in this framework. Use this tag for questions related to this type of document.

cgpdfdocument is part of Apple's Core Graphics framework. It specifically refers to a document that contains PDF (Portable Document Format) drawing information used in this framework. Use this tag for questions related to this type of document.

104 questions
0
votes
1 answer

Custom ScrollView to render PDF using CGPDFDocument crashes app randomly

I am rendering PDF documents using a custom UIScrollView but lately this has been crashing the app randomly - sometimes crashes after PDF is rendered, sometimes after dismissing the UIViewController in which this custom ScrollView is a subview. I am…
ilight
  • 1,622
  • 2
  • 22
  • 44
0
votes
1 answer

CGPDFDocumentRef iOS 10 memory leak

This is more of a question and an answer. I had noticed in iOS 9 I had no memory issues using the CGPDF Library, and flipped through x amount of pages with no issues. See the attached screenshot, notice each page swipe the memory went…
Jh2170
  • 116
  • 4
0
votes
0 answers

Best way to use variable across functions in python

I need to refer to the same variable in several functions in a python script. (The write context of a CGPDFDocument). I can either write global writeContext in every function; or add the variable as an argument to every function; ....both of which…
benwiggy
  • 1,440
  • 17
  • 35
0
votes
1 answer

PDF merge is increasing up file size

I merge several single pdf pages in to a single file. The merge itself works good. All pages are in the right place and they look right. The merge code looks like this: CGContextRef writeContext = CGPDFContextCreateWithURL((CFURLRef)originalURL,…
MatzeLoCal
  • 392
  • 3
  • 14
0
votes
2 answers

How to display CGPDFDocument in swift?

Hi I have a CGPDFDocument object. I want to open this document by either showing it in my app or using an external application. Here is the code I have so far. in SWIFT let cfData = CFDataCreate(kCFAllocatorDefault,…
Jurian Amatsahip
  • 187
  • 1
  • 2
  • 11
0
votes
1 answer

How to get the trailer dictionary from a CGPDFDocumentRef?

I know this question has been asked before, but I'll be more specific. I have a CGPDFDocumentRef document and I want to find the trailer, ideally in the form of a CGPDFDictionaryRef so that I can look into its Encrypt dictionary and see if it…
user714171
  • 363
  • 1
  • 3
  • 12
0
votes
1 answer

CGPDFDocument scaling

I am just starting to build an app that will display PDF documents. I've been experimenting, subclassing UIView and using the code from Apples demo. I have a PDF document that contains an image that is 1024 x 748 pixels at 131 ppi, so that it SHOULD…
Alpinista
  • 3,751
  • 5
  • 35
  • 46
0
votes
1 answer

iphone CGPDFDocumentRef Huge memory leak

I've been doing research because my pdf viewer app keeps crashing around page 4/5 because of a memory leak that happens every time you turn a page. It turns out that apple has a bug. see here: https://devforums.apple.com/message/9077#9077 From what…
user422241
  • 11
  • 5
0
votes
1 answer

Add text to PDF Page using CGPDFContext on OS X

I have tried to add text to an exist PDF file, which has 5 pages, by CGPDF and CGPDFContext but failed. I have set the font, DrawingMode, FillColor... Did I miss something in the code? CGContextRef writeContext = NULL; CGRect mediaBox; …
0
votes
1 answer

Tiled PDF view is leaking memory (non ARC)

So I work on a very large and very old legacy project that was coded about 5 years ago in non-ARC objective c code. I took over from the previous developers and now have to maintain this beast. The app allows users to read PDF pages that are…
Nick Kirsten
  • 1,187
  • 11
  • 27
0
votes
1 answer

iOS pdf search highlight result

I have found a great post here http://web.archive.org/web/20131122162015/http://blog.random-ideas.net/?p=184 that sow how to use scanner but how to highlight the result?
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
0
votes
1 answer

iOS How to get all words coordinates in PDF page

I have looked through many tutorials and usually stack users trow links to the pdfkitten, but as I've tested it I have not satisfied with result. So the search does not work with multiply word and etc. So what I am looking for I need to get all…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
0
votes
0 answers

iOS CGPdf highlight text using CGrect

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…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
0
votes
2 answers

Unable to read text from Pdf in ios

I am trying to extract text for pdf document in my iOS application, I am using CGPDFScanner.. I used the reference from these links: need List search functionality in VFR Reader Displaying and Searching PDF Content on iPhone The methods…
ViruMax
  • 1,216
  • 3
  • 16
  • 41
0
votes
1 answer

Image drawing on PDF fails to draw image with transformation and outputs wrong

I've a problem with drawing images on PDF. I do apply scaling, rotation, move, etc. to an image and draws that image on the PDF. But drawing is not outputting correctly. When I do rotate image, it just scales and doesn't rotate. Here, I explain in…
Paresh Thakor
  • 1,795
  • 2
  • 27
  • 47