How to remove image from pdf? - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
01 Jun 2018
During last few days we're experiencing some delay in website stmp provider channel.
Some notification email from the website might not reaching containers.
We're working on a definitive solution.
Read More...
Questions about iOS development and PDF
  • Page:
  • 1
  • 2

TOPIC: How to remove image from pdf?

How to remove image from pdf? 3 months 2 weeks ago #13550

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
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?

Please Log in or Create an account to join the conversation.

How to remove image from pdf? 3 months 2 weeks ago #13551

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 44
  • Thank you received: 3
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
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
on event that you prefer.

Please Log in or Create an account to join the conversation.

How to remove image from pdf? 3 months 2 weeks ago #13553

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.

Please Log in or Create an account to join the conversation.

How to remove image from pdf? 3 months 2 weeks ago #13554

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
- (void)vAddImageWithImage:(UIImage *)image withRect:(PDF_RECT)rect;
in My pdfview file , there is no method with this name.

Please Log in or Create an account to join the conversation.

How to remove image from pdf? 3 months 1 week ago #13581

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 44
  • Thank you received: 3
Hi,
You could check our knowledgebase here to add an image as annot

Please Log in or Create an account to join the conversation.

How to remove image from pdf? 3 months 1 week ago #13583

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
Hi,
Thanks for your response , but my Query was about how to remove image added to pdf.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum