Questions tagged [cgpdf]

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”.

60 questions
1
vote
1 answer

CGPDFScannerScan doesn't fire callback functions

I parse pdf files using Quartz. Everything works fine except for one file. Callback functions are not call at all. My operator table has been created, I added operators into it with CGPDFOperatorTableSetCallback. Everything seem ok, just callbacks…
bob
  • 382
  • 2
  • 17
1
vote
1 answer

CGPDF - Saving images with FlateDecode Filter

I'm writing a PDF parser for work, and we're using Core Graphics to read in all of the data with callbacks and then writing it out with Lib Haru because our client needs to write out "real" annotations and CG can't do it. Well, I've gotten to the…
patt4179
  • 65
  • 7
1
vote
2 answers

EDIT CGPDFObject of the pdf

i try long time to parse a pdf file with quartz cgpdf api, but my question is true that CGPDF API can't edit the object saved in the pdf? it mean the api used just only for reading file?
0
votes
1 answer

open pdf in to another pdfviewer application from my application

I have one pdf in my application and I want to open that pdf but not in my applicaton. When ever i'll click or open that pdf it will ask me to open that pdf in another application of pdf viewer availbale on my device i wnt to know that is it…
Aakil Ladhani
  • 984
  • 9
  • 32
0
votes
1 answer

How to find the pdf document font using CGPDFScanner in iphone app?

I am getting the "F1.0" in Tf callback method in CGPDFScanner. But I am not getting how I can go ahead with "F1.0" After doing some search I come to know that it is king of font detail. How Can I Decode this value.
uttam
  • 1,364
  • 4
  • 20
  • 35
0
votes
1 answer

How to change the background color of CGPDFPageRef, and how to remove the page's shadow

I'm trying to draw content in a UIWebView instead of a UIView, because I like UIWebView's ability to zoom in and out by pinching. Here's my code: // setup environment CGRect outputRect = myWebView.bounds; CFMutableDataRef data =…
DTs
  • 1,196
  • 1
  • 11
  • 28
0
votes
2 answers

Loading PDF in iPad

I am using CGContextDrawPDFPage class to render PDF in my app without any trouble. But, the amount of time taken to load the book is a bit more and the time taken to render the page is proportional to the number of pages in the PDF. In my case,…
A for Alpha
  • 2,904
  • 8
  • 42
  • 76
0
votes
1 answer

CGPDFArray popped but zero count

I'm running the following: if (CGPDFDictionaryGetObject(dict, "DescendantFonts", &object)) { CGPDFObjectType objectType = CGPDFObjectGetType(object); switch (objectType) { case kCGPDFObjectTypeArray: { CGPDFArrayRef…
Ken
  • 30,811
  • 34
  • 116
  • 155
0
votes
1 answer

CGPDFScanner, Identity-H and decompression

My instance of CGPDFScanner is scanning a test pdf file. At a given time, the current font dictionary has Encoding value Identity-H and a FontDescriptor dictionary with key FontFile2. This key happens to be for a stream value, whose dictionary has…
Ken
  • 30,811
  • 34
  • 116
  • 155
0
votes
1 answer

Extracting font data with CGPDFScanner

I'm using CGPDFScannerto scan PDF. When the scanner encounters something like: BT /F13 12 Tf 288 720 Td (ABC) Tj ET I use operator callbacks to extract the Tf, Td and Tj data. How do I extract /F13?
Ken
  • 30,811
  • 34
  • 116
  • 155
0
votes
1 answer

Can CGPDFDataFormatJPEG2000 be used for something other than a JPEG2000 image?

Using the Quartz 2D PDF routines, can the CGPDFDataFormat format of a CGPDFStreamRef PDF stream be equal to CGPDFDataFormatJPEG2000 in any case other than for an XObject image with a filter of /JPXDecode? In other words, is the…
F'x
  • 12,105
  • 7
  • 71
  • 123
0
votes
1 answer

How to get PDF box size from CGPDFPage

I'm getting errors however I try to get the mediabox of a PDF Page in Swift.: if let pdf = CGPDFDocument(pdfURL) { let numberOfPages = pdf.numberOfPages for index in 0...numberOfPages { let pdfPage = pdf.page(at: index) …
benwiggy
  • 1,440
  • 17
  • 35
0
votes
1 answer

How to get values out of these callbacks when reading a PDF?

I am trying to read a PDF file. Below callbacks also print the messages but there's nothing I can get out of the PDF. let pdfBundlePath = Bundle.main.path(forResource: "sample", ofType: "pdf") let pdfURL = URL.init(fileURLWithPath:…
Hemang
  • 26,840
  • 19
  • 119
  • 186
0
votes
1 answer

Swift dictionary doesn't want to populate from C Callback function

I'm writing a PDF Parser in Swift and I've reached the point where I get all the font data with a callback function (CGPDFDictionaryApplyFunction), the getFont function is supposed to populate the fonts dictionary in the PDFFontCollection…
0
votes
0 answers

Coding a PDF Text Parser in swift

I'm currently developing a pdf text parser completely in swift. I was looking trough the PDFKittens code and found this in the stringwithpdfstring method (In SimpleFont.m) taking a CGPDFStringRef as parameter. const unsigned char *bytes =…