cgpdfdocument

How to access hyperlinks in PDF documents (iPhone)?

Is it possible to get access to "internal" links in PDF documents using CGPDFDocument, or other means? I'm building a simple reader app and would like to deliver my content in PDF form, but if I can't support links between pages in the doc this probably isn't going to work. This question is similar, but does not address the issue of ho...

reflow text in PDF documents (iPhone, CGPDFDocumentRef)

I'm using CGPDFDocumentRef to render PDF content for an ebook app. This works great, but it seems to preclude allowing the user to read text in "landscape mode" by tilting the phone- I have no way to reflow the text to make use of the wider space. (Yes, I can scale the whole page to fit the new space, but that's not really helpful to t...

Creating PDF with CGContextDrawPDFPage Fails with white text

I'm trying to merge multiple PDFs, i'm copying one-by-one all pages into PDF, but the pages have white color text. means text are not in displayable manner. counld you help..? Thanks In advance...! My Function to Merge PDF: -(void)mergePDFs:(NSArray*)pdfList{ CGContextRef pdfContext; CFStringRef path; CFURLRef url; CFMutabl...

Is there a way to programmatically scroll to a PDF page within a UIWebView?

It is possible to use JavaScript to set the pixel y-offset of a UIWebView, e.g.: [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"scrollTo(0, %d)", offset]]; So is there a way to get: The pixel height of an individual page of a PDF within the web view? The size of the gap between pages? Is this informat...

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

Hello guys, 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 more detail: I place an image on UIWebView to make fake effect of image exact...

PDF viewing/annotating library for iPhone?

Hi, I am currently working on an educational project where I would like to add some PDF reading functionality to an iPhone app. I know that it is possible to add a UIWebView and display the PDF there, however I would like to add the ability to show page number, 'next', 'previous' buttons etc. Is CGPDFDocument the direction that I should...

Reading PDF files as string through iPhone application

I am facing some problem in iPhone application development for "Reading PDF". I have tried following code. I know I have used wrong methods for parsing - parsing methods are just used for searching purpose. But I want to convert entire pdf text in to a string. Say for example Apple's MobileHIG.pdf - I have used in this code. @implementa...

iPhone: CoreGraphics and memory management

Can someone tell me what I am doing wrong here? I use this method to flip through pages in a PDF. But something in the code seems to not be released properly because every-time I pull a PDF page that contains an image my memory footprint increases. I am fairly new to CoreGraphics, and can't for the life of me figure out where this method...

Portion from CGPDFPage + Scale (zoom)

I wanna take a rect from CGPDFPage (the portion of image around the user's touch point(x,y)) and scale it by a scaleFactor (ie 2x). Below the code I've used to get CGPDFPage's rect. The problem with it is the scaleFactor support. The idea is: 1) pageRect size is pageRect.size *2 2) myThumbRect (the region to zoom) become resultImageSize/...

Show PDF in iPad using CGPDF APIs

I have learned Apple has release CGPDF APIs in SDK 3.2 for drawing PDF context. What I understand from these APIs is that you can draw a PDF to a data object or a PDF file. You can then export it, may be, to your sandbox's directory OR add as an attachment in the mail. But I am not sure if we can use these APIs to read a PDF from app...

iphone PDF view CGPDFDocument

I am developing an app where I need to show PDF documents. After many hours of googling I was able to build up a view to show the PDF document fetched from a URL. I know only to display a single page. using CGPDFDocumentGetPage(ref, pageNumber). What I would like to have. Pagination function. Zoom Scrolling ...

How to display two pages in one scrollview page with zooming from PDF?

Hello everyone, I want show per page pdf in portait mode and display two pages when rotate to landscape mode on ipad . I had search on internet and can't find any solution. I thought two possible way. 1.Using webview but I don't know how to display two page in one webview in a webview. 2.Using CGPDF API read from two page and merge...

PDF parsing for an eBook app

Looking for some help on the pros and cons of using UIWebView vs. CGPDF for the purpose of creating an eBook reader app. The content would be in the form of PDF, thus Iam trying to figure out which of the two API's - UIWebView or CGPDF would work the best. Targeting features like - zoom, table of contents, notes and annotations, search....

Iphone CGPDFDocument rendering incorrectly

I am creating a PDF Context and changing it to a UIImage to swipe through quickly. Currently some of the text is rendered strangely, seems to be all squashed together and ontop of each other line. The code I use is as follows: - (UIImage*)loadImageFromBundle:(NSString*)URL { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(...

iphone CGPDFDocumentRef Huge memory leek

I've been doing research because my pdf viewer app keeps crashing around page 4/5 because of a memory leek that happens every time you turn a page... It turns out that apple have a bug. see here: https://devforums.apple.com/message/9077#9077 from what I understand you have to release & retain the pdf document every time you change pag...

CGPDFDocumentCreateWithURL is giving me 0x0 nil

Hello, I have file test.pdf in my Application Bundle. I run test in iPhone Simulator (iPad) and I cannot get the CGPDFDocumentRef populated. Am I going crazy or what?!? here is a piece of code from the sample application made especially for this (ViewController class): - (void)viewDidLoad { [super viewDidLoad]; // below code to...

Extracting thumbnail image from CGPDFPageRef

I am attempting to create thumbnail images for a CGPDFDocument. In the PDF Document Parsing section of the Quartz Programming Guide, there is the following code: CGPDFDictionaryRef d; CGPDFStreamRef stream; // represents a sequence of bytes d = CGPDFPageGetDictionary(page); // check for thumbnail data if (CGPDFDictionaryGetStream (...

Setting a CGPDFObjectRef to value

Does anyone have a way to change the information contained in a CGPDFObjectRef? Basically since CGPDFObject can represent any of the subtypes (CGPDFInteger, ie.) you would think you could set an existing CGPDFObjectRef that is type integer to an integer; however, I have played with this for quite some time with no success and was wonderi...

How to show a PDF page by page using horizontal swipe in iphone ?

Hi, I want to create a page by page PDF reader. I know how UIWebView can be used to show the PDF but It will load the entire PDF and want to show one page at a time. The PDF is stored locally. Next and previous PDF Pages should be loaded depending on the horizontal swipe. How to show a single page along with horizontal Swipe and Zoo...

iPhone/iPad draw pdf like iBooks?

Hello, Does anyone know how to use core graphics to draw a pdf like in iBooks. I can already draw a pdf page using core graphics but was curious how iBooks shows a lower quality view of each page so it loads fast and then when you stay on a page longer it renders it a full quality. This makes it able to open the pdf without having to ma...