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

How to remove image from pdf?

More
IP: 192.168.0.71 8 years 6 months ago #13550 by doubleeye
I have added image using

{
// Get page
PDFPage *page = [m_doc page:2];

// Create page content
PDFPageContent *content = [[PDFPageContent alloc] init];

// Get the image to add
UIImage *img = [UIImage imageNamed:@"pink"];

// Create a Doc Image instance
PDFDocImage *_image = [m_doc newImage:img.CGImage :YES];

// Add the image as page resource
PDF_PAGE_IMAGE rimg = [page addResImage:_image];
[content gsSave];

// Set the matrix (image position/size on page)
PDFMatrix *matrix = [[PDFMatrix alloc] init:20 :20 :20:20];
[content gsCatMatrix:matrix];
matrix = nil;

// Draw the image on page content
[content drawImage:rimg];
[content gsRestore];

// Add the content on the page
[page addContent:content :true];

// Save the file
[m_doc save];
}


Image is added to the pdf, but on some event this image need to be removed. How can I do that?
More
IP: 192.168.0.71 8 years 6 months ago #13551 by federico
Hi,
Adding image in PDF like you do makes the image an integral part of the PDF and so you can't delete it. You should add image like annot if you want to remove it, so you could use this PDFView's method
Code:
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
on event that you prefer.
More
IP: 192.168.0.71 8 years 6 months ago #13553 by doubleeye
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.
More
IP: 192.168.0.71 8 years 6 months ago #13554 by doubleeye
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.
More
IP: 192.168.0.71 8 years 6 months ago #13581 by federico
Hi,
You could check our knowledgebase here to add an image as annot
More
IP: 192.168.0.71 8 years 6 months ago #13583 by doubleeye
Hi,
Thanks for your response , but my Query was about how to remove image added to pdf.
Time to create page: 0.544 seconds
Powered by Kunena Forum