- Posts: 3
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
Cordova, Xamarin, Basic4Android topics are listed here.
Add image as attachment
- anchalsahu
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.71
8 years 2 months ago #13296
by anchalsahu
Add image as attachment was created by anchalsahu
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
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
IP: 192.168.0.71
8 years 2 months ago #13299
by nermeen
Replied by nermeen on topic Add image as attachment
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
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
Code:
page.AddAnnotAttachment("/mnt/sdcard/image.png", 0, new float[]{300,500,330,530})
Code:
/**
* 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)
IP: 192.168.0.71
8 years 2 months ago #13306
by emanuele
Replied by emanuele on topic Add image as attachment
Here is also the Obj-C example to add an attachement:
Code:
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];
Time to create page: 0.504 seconds