Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-16-2010, 03:31 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 1
Max Gontar is on a distinguished road
Question How to get PDF links from CGPDFDocument?

Hello!

I'm trying to write a simple PDF viewer using CGPDFDocument, based on QuartzDemo.
There is common rendering:

Code:
-(void)drawInContext:(CGContextRef)context
{
    // PDF page drawing expects a Lower-Left coordinate system, 
    // so we flip the coordinate system before we start drawing.
    CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
    CGContextScaleCTM(context, 1.0, -1.0);

    // Grab the first PDF page
    CGPDFPageRef page = CGPDFDocumentGetPage(pdf, pageNumber);
    // We're about to modify the context CTM to draw the PDF page
    //  where we want it, so save the graphics state 
    // in case we want to do more drawing
    CGContextSaveGState(context);
    // CGPDFPageGetDrawingTransform provides an easy way to get the
    // transform for a PDF page. It will scale down to fit, including any 
    // base rotations necessary to display the PDF page correctly. 
    CGAffineTransform pdfTransform = 
            CGPDFPageGetDrawingTransform(page, 
                    kCGPDFCropBox, self.bounds, 0, true);
    // And apply the transform.
    CGContextConcatCTM(context, pdfTransform);
    // Finally, we draw the page 
    // and restore the graphics state for further manipulations!
    CGContextDrawPDFPage(context, page);
    CGContextRestoreGState(context);
}
As I understand, its only drawing, so all structure navigation or outgoing links should be handled manually (ex. in touch event).

There are functions which will set URL or create element with URL.

Question is: how to get outgoing link URL from certain PDF block?

Thank you!

Similar questions:
PDF hyperlinks on iPhone/iPad
How to access hyperlinks in PDF documents (iPhone)?
Max Gontar is offline   Reply With Quote
Old 07-20-2010, 09:55 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Ukraine
Posts: 18
kenshin is on a distinguished road
Default

if you want to see links of your pdf, you need parsing each pdf page, find where links contains( in which key ), then gather it in array, get they bounds and only then display on the page. See documentation about CGPDFDictionary and how get information from it.
kenshin is offline   Reply With Quote
Reply

Bookmarks

Tags
cgpdfdocument, hyperlinks, links, pdf, url

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 384
12 members and 372 guests
AragornSG, ChrisYates, coolman, davejas69, guusleijsten, hussain1982, jbro, Kryckter, locombiano89, Mah6447, stanny, WeaselPig
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:43 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0