- Posts: 21
- Thank you received: 0
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?
IP: 192.168.0.71
8 years 6 months ago #13550
by doubleeye
How to remove image from pdf? was created 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?
{
// 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?
IP: 192.168.0.71
8 years 6 months ago #13551
by federico
Replied by federico on topic How to remove image from pdf?
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
on event that you prefer.
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;
IP: 192.168.0.71
8 years 6 months ago #13553
by doubleeye
Replied by doubleeye on topic How to remove image from pdf?
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.
in My pdfview file , there is no method with this name.
IP: 192.168.0.71
8 years 6 months ago #13554
by doubleeye
Replied by doubleeye on topic How to remove image from pdf?
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.
in My pdfview file , there is no method with this name.
IP: 192.168.0.71
8 years 6 months ago #13581
by federico
Replied by federico on topic How to remove image from pdf?
Hi,
You could check our knowledgebase here to add an image as annot
You could check our knowledgebase here to add an image as annot
IP: 192.168.0.71
8 years 6 months ago #13583
by doubleeye
Replied by doubleeye on topic How to remove image from pdf?
Hi,
Thanks for your response , but my Query was about how to remove image added to pdf.
Thanks for your response , but my Query was about how to remove image added to pdf.
Time to create page: 0.544 seconds