Add image as attachment - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1

TOPIC: Add image as attachment

Add image as attachment 3 months 2 weeks ago #13296

  • anchalsahu
  • anchalsahu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 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

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

Add image as attachment 3 months 2 weeks ago #13299

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 789
  • Karma: 20
  • Thank you received: 58
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)

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

Add image as attachment 3 months 2 weeks ago #13306

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 489
  • Karma: 15
  • Thank you received: 53
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];

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

  • Page:
  • 1
Powered by Kunena Forum