cancel
Showing results for 
Search instead for 
Did you mean: 

Add attachments to the Interactive form of a Web dynpro application

Former Member
0 Kudos

Hi,

Can u tell me if we can add attachments to the interactive form of a web dynpro application at runtime?

If yes, can anyone tell me how to implement it?

Thanks,

Jyoti

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Sudheer,

We are using<b> NWDS ver 7.0.06, SP6 and EP 7.0</b>

But I am not getting the <b>IWDPDFDocumentAttachment</b> interface under com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api

Please let me know for the versions mentioned above what should be used to achieve this feature.

Regards,

Jyoti

krishanu_biswas
Active Participant
0 Kudos

Hi Guys,

Attachment API for the Interactive form have been made available with the following:

NW04s SP09 Web Dynpro Runtime + hotfix release (Note: 982023)

NW04s SP10 Web Dynpro Runtime + hotfix release (Note: 984868)

SP11 onwards > Base SAP release

When you have the right runtime installed on your server, try the following code (Its a rough code, please adjust your code accordingly):

IWDPDFDocumentInteractiveFormContext iFormContext = 
	WDPDFDocumentFactory.getDocumentHandler(controller, controlId).getDocumentContext();

IWDPDFDocumentAttachment attachment = iFormContext.newAttachment();

attachment.setName("name");
attachment.setResource(resource);

iFormContext.setAttachment(attachment);

I am not sure, if you have already tried the attachment capability to some extent or have you faced any exception while doing so. Please try, things should work fine.

Best Regards,

Krish

Former Member
0 Kudos

Hi Jyothi,

Use NWDS ver 7.0.10, SP10

Attachment API is missing in SP9 and SP7.

I have successfully attached a attachment to PDF Form using SP10

krishanu_biswas
Active Participant
0 Kudos

Hello Sudheer,

Attachment API is missing in SP07, true. But, it is available in SP09 (NW04s). Please apply the hotfix release i have mentioned in my last reply. It should work. It works on SP10 as well.

Best Regards,

Krish

Former Member
0 Kudos

Hi Krish,

I am talking about NWDS but not about server service packs.

It is not availble in NWDS 7.0.9

Thanks,

Sudheer

Former Member
0 Kudos

Hi Sudheer,

In the line of code:

IWDPDFDocumentInteractiveFormHandler documentIFHandler=

WDPDFDocumentFactory.getDocumentHandler(<b>view</b>.getContext().getController(),

"InteractiveForm");

What is the <b>view</b> over here. It does not recognise it when I do an organise import. Neither is it accepting the view name.

Thanks & Regards,

Jyoti

Former Member
0 Kudos

Hi Jyothi,

Do let me know what is your configuration imeen which service pack you are using?

This should be in public static void wdDoModifyView(IPrivatePdfExplorerView wdThis, IPrivatePdfExplorerView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

Former Member
0 Kudos

Hi Jyoti,

I'm Ravi.Golla. Have you solved the problem of attaching files to pdf as attachments. if yes, Please tell me what to do. i could not find any documents related to this topic. This is very Urgent for our project. If you have any sample code, that will be helpful. my e-mail id: raviinuk@gmail.com, raviinuk@hotmail.com

Thanks

Regards

Ravi

Former Member
0 Kudos

Hi Jyothi,

Try this code.

/********************************/

IWDPDFDocumentInteractiveFormHandler documentIFHandler=

WDPDFDocumentFactory.getDocumentHandler(view.getContext().getController(),

"InteractiveForm");

IWDPDFDocumentInteractiveFormContext documentIFContext = documentIFHandler.getDocumentContext();

//Here we will be creating a new attachment

IWDPDFDocumentAttachment attachment=documentIFHandler.newAttachment();

File file= new File("D:
TempShare
pdf
sud.txt");

InputStream is = new FileInputStream(file);

//Here we will be setting content of attachment

attachment.setResource(is);

//Finally we will be adding attachment to Context

documentIFContext.setAttachment(attachment);

/*******************************/

Former Member
0 Kudos

Hi Jyothi,

Have you attached any document ?

If yes please do let us know.

Thanks,

Sudheer

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Jyoti,

1. The IWDPDFDocumentAttachment API is now available with NW 04s SP Stack 09. Java doc is the only source of information on how to use these APIs as of now: https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/a...

2. WDEmbedFileRights is a set of rights given to a PDF document to inculcate attachment handling capability.

Best regards, Bertram

Former Member
0 Kudos