RadaeePDF.com :: Topic: Add image as attachment (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.

TOPIC: Add image as attachment

Add image as attachment 2 weeks 2 days ago #13296

  • anchalsahu
  • anchalsahu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi,

I want to allow a user to select an image from the device and attach it to the pdf file.

Is it possible? Can you please share details about this feature?

Thanks,
Anchal
The administrator has disabled public write access.

Add image as attachment 2 weeks 2 days ago #13299

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 739
  • Thank you received: 52
  • Karma: 20
Dear Anchal,
To include such a feature you should customize the Objective-C/Java framework .

You need to implement the image selection yourself based on your requirements.

To add an image attachment, you can use the method Page.AddAnnotAttachment
page.AddAnnotAttachment("/mnt/sdcard/image.png",  0, new float[]{300,500,330,530})
/**
	 * add a file as an attachment to page.<br/>
	 * you should re-render page to display modified data.<br/>
	 * this can be invoked after ObjsStart or Render or RenderToBmp.<br/>
	 * this method require professional or premium license, and Document.SetCache invoked.
	 * @param path absolute path name to the file.
	 * @param icon icon display to the page. values as:<br/>
	 * 0: PushPin<br/>
	 * 1: Graph<br/>
	 * 2: Paperclip<br/>
	 * 3: Tag<br/>
	 * @param rect 4 elements: left, top, right, bottom in PDF coordinate system.
	 * @return true or false.<br/>
	 * the added annotation can be obtained by Page.GetAnnot(Page.GetAnnotCount() - 1), if this method return true. 
	 */
    final public boolean AddAnnotAttachment(String path, int icon, float[] rect)
The administrator has disabled public write access.

Add image as attachment 1 week 6 days ago #13306

  • emanuele
  • emanuele's Avatar
  • OFFLINE
  • Moderator
  • Posts: 462
  • Thank you received: 52
  • Karma: 15
Here is also the Obj-C example to add an attachement:
    PDF_RECT rect;
    rect.left = 100;
    rect.top = 100;
    rect.right = 150;
    rect.bottom = 150;
    PDFPage *page = [m_doc page:m_cur_page];
    [page addAnnotAttachment:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"] :0 :&rect];
    [m_doc save];
The administrator has disabled public write access.
Powered by Kunena Forum