CGPDF is an iOS and Mac OS X API for reading and writing PDF documents. CG at the start is an abbreviation of “Core Graphics”.
Questions tagged [cgpdf]
60 questions
11
votes
1 answer
CGPDFDocument unable to read pdf
I followed the following example to view a pdf in my App (Xamarin.iOS). Everything worked fine until recently I started to notice some pdf files can't be read using this method.
I open and got info on my mac and I noticed the following:
if I export…

ScarletMerlin
- 465
- 4
- 24
6
votes
2 answers
UIGraphicsBeginPDFPage() randomly crashes on 64bit devices (CGPDFSecurityManagerCreateDecryptor ())
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…

Arex
- 81
- 5
5
votes
2 answers
EXC_BAD_ACCESS within call to CGPDFContextClose
My iPad app encounters an EXC_BAD_ACCESS message within the call to CGPDFContextClose in the following method. It happens only for certain pages, and only for one document so far (which happens to be our help document, unfortunately).
-…

Robert Gowland
- 7,677
- 6
- 40
- 58
5
votes
2 answers
Merge 2 pdf files in iOS
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…

user2173679
- 51
- 1
- 2
5
votes
0 answers
CGPDFObject get ID
How can I obtain the ID of a CGPDFObject?
I have this dictionary in my PDF:
3 0 obj
<< /Type /Pages /MediaBox [0 0 612 792] /Count 5 /Kids [ 2 0 R 9 0 R 15 0 R
21 0 R 27 0 R ] >>
endobj
which I obtain using:
CGPDFDictionaryRef…

Hasib Samad
- 1,081
- 1
- 20
- 39
4
votes
1 answer
What is this error in Apple's "ZoomingPDFViewer" code example from CGContextDrawPDFPage : KSTFBB+Helvetica: FT_Load_Glyph failed: error 133
I am looking at Apple's ZoomingPDFViewer example (source available from link). And when it runs, it gives this error:
ZoomingPDFViewer[5751] : KSTFBB+Helvetica: FT_Load_Glyph failed: error 133.
It happens on line 100 of…

lindon fox
- 3,298
- 3
- 33
- 59
4
votes
3 answers
How to get indirect reference to a page object with CGPDF?
According to Adobe's "Document management - Portable Document Format - Part 1: PDF 1.7" (Pdf32000_2008.pdf), section 12.3.2.1 states:
A destination defines a particular
view of a document, consisting of the
following items:
The page of the…

user476489
- 101
- 6
4
votes
1 answer
compare two CGPDFDictionary
Is the a way to compare two CGPDFDictionaries?
There is a function memcmp, but it doesn't work for me, because dictionaries are in different memory cells.

Koteg
- 497
- 7
- 16
3
votes
0 answers
Pdf Page content modification using objective-c
I wanted to replace the content of a pdf page. I have done that by the following code,
-(void)modifyPdf:(NSString *)pdfPath atPage:(int)_page
{
NSURL* url = [NSURL fileURLWithPath:pdfPath];
CGPDFDocumentRef document = CGPDFDocumentCreateWithURL…

Vignesh
- 10,205
- 2
- 35
- 73
2
votes
3 answers
Creating PDFs from iOS text fields
I'm working on the requirements & specifications for a new iOS app intended for use by certain professionals working "in the field". All day long for weeks on end, these folks have a sizable reporting burden to their superiors using standardized…

dgt
- 21
- 1
2
votes
3 answers
CGPDFPage Drawing causing memory problems (Swift 3)
I'm currently developing an app and I want to implement a PDF reader on top of UICollectionView.
I am using a custom UIView on each cell which renders the corresponding PDF page:
weak var page: CGPDFPage! {
didSet { setNeedsDisplay()…

Nick Marinov
- 128
- 1
- 10
2
votes
1 answer
How do I setup a CGPDFOperatorTableSetCallback in SWIFT (not Objective C)
I am trying to parse PDF files and I've nearly got the code working. The only thing I can't seem to figure out is to translate the following Objective C code, into Swift. I need to call my own written function to register it as a callback.
The…

0xT0mT0m
- 656
- 5
- 15
2
votes
2 answers
IOS PDF Reader with search , annotation and bookmarks
I'm trying to do a PDF Reader which have the following features:
bookmarks
zooming
highlight //annotation or just changing the background of the rect
search
what I'm using is vfr/Reader :
https://github.com/vfr/Reader
it have the zooming function…

Ghiath Erksoussi
- 31
- 4
2
votes
1 answer
CGPDFPageRef not rendering FreeText annotations
I am using CGContextDrawPDFPage to draw pdfs in a layer using standard techniques as mentioned here . The PDF Viewing is perfect for most of the pdfs. However FreeText Annotations in the PDF are not rendered at all. QLPreviewController successfully…

Qamar Suleiman
- 1,228
- 2
- 18
- 31
2
votes
2 answers
Rendering PDF in iOS
Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or…

Arun Gupta
- 2,628
- 1
- 20
- 37