Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Perform action when tap on image added to pdf.

More
IP: 192.168.0.71 7 years 11 months ago - 7 years 11 months ago #13563 by doubleeye
Hi I have added image to PDF using below method

- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect
{
// Create the cache file
NSString *tp = NSTemporaryDirectory();
tp = [tp stringByAppendingPathComponent:@"cache.dat"];
[m_doc setCache:tp];

// Create the PDFPage instance of the current page
PDFPage *page = [m_doc page:currentPage];

// Create the CGImageRef of the image
CGImageRef ref = [image CGImage];

PDFDocImage * docImage = [m_doc newImage:ref :YES];
// Add the image
[page addAnnotBitmap:docImage :&rect];

// Re-render the current page
[m_view vRenderSync:currentPage];
[self refresh];

// Save the PDF file
// [m_doc save];
}

Now I want to perform action when user tap on that image , is there any way I can achieve that?
Last edit: 7 years 11 months ago by doubleeye.
More
IP: 192.168.0.71 7 years 11 months ago #13565 by federico
Hi,
I suggest you to use this method from RDPFViewController class:
Code:
-(void)OnAnnotClicked:(PDFPage *)page :(PDFAnnot *)annot :(float)x :(float)y;
In this method you could get the annot clicked and so you could check if the annot's types are the same:
Code:
if (annot.type == yourImgAnnot.type) { //do something }
or you could check if the annot's objects are the same:
Code:
if (annot == yourImgAnnot) { //do something }
Time to create page: 0.406 seconds
Powered by Kunena Forum