cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding toolbars in Interactive form element thru code

Former Member
0 Kudos

Hi all,

I am using interactive form element to embed a purely readonly pdf (but content is dynamic) since Iframes is deprecated (any other way?).

I wish to hide the toolbars, options of thumbnails etc. I added the code below to my view controller. However, it does not seem to work. All the toolbars are still showing. Did i do something wrong?

IWDPDFDocumentInteractiveFormHandler iFormHandler =

WDPDFDocumentFactory.getDocumentHandler(wdThis.wdGetAPI(),

"InteractiveForm");

IWDPDFDocumentAppearance appearance =

iFormHandler.getDocumentContext().getAppearance();

appearance.hideMenuBar(true);

appearance.hideToolBars(true);

appearance.hideWindowControl(true);

Also, the formating (fonts etc) of the pdf in the portal seems to be different from that seen in R/3 form.

Anyone?

Accepted Solutions (1)

Accepted Solutions (1)

maarten_duits2
Participant
0 Kudos

Hello,

To me the code looks correct. I got one thing, it maybe sounds silly, but is the name of your .xdp file really "InteractiveForm" ?

I don't understand your last point exactly. Do you mean that when you look at the interactive form (IF) in the portal the font type looks different then when you look at the pdf file outside the portal (ie in Adobe Reader standalone)? If so, then you should open the pdf file in the reader and via "File" - "Properties" you can take a look which fonts are all included in the pdf and see if this is the same . For performance reasons it's best to use font Myrid pro (i think you spell it this way).

Hope the answer will help.

Kind regards,

Maarten.

Former Member
0 Kudos

Hi Maarten,

I am not really sure what i should put in the method. The id of the interactive form element is "InteractiveForm" and the template source is "blahblah.xdp" should i put blahblah instead? Also, what is this xdp file actually? i did not actually put in and such file. should i?

For last point, what is happening is that some users see a the pdf in a certain font/layout while other users are seeing the old font/layout. The browser caches have already been cleared. I dont know why this is happening...

Former Member
0 Kudos

Update: i tried with blahblah, and blahblah.xdp and it both results in exceptions. (null InteractiveFormwith the following controlID : blahblah.xdp does not exist.)Which would lead me to believe that putting in the id of the Interactive form is correct since i did not have any exceptions.

maarten_duits2
Participant
0 Kudos

Hello Ah,

You're completly right. You should use the ID. I looked at my work where we are also using this code and the only difference is the we also set the property that the form should be a dynamic form.

<a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/api/IWDPDFDocumentInteractiveFormContext.html">https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/api/IWDPDFDocumentInteractiveFormContext.html</a>

I hope this helps.

Kind regards,

Maarten

Former Member
0 Kudos

Maarten,

Are you aware if i need to install some adobe support packages/plugins in order for this to work? Becos my NWDS does not have all the advance adobe features.

maarten_duits2
Participant
0 Kudos

Hi,

After the installation of the NWDS, did you installed the Adobe LifeCycle Designer? You need to install it yourself. You can download it from service market place.

Are you developing Adobe Interactive Forms Java or ABAP?

Maybe this will help.

Maarten

Former Member
0 Kudos

Maarten,

I really appreciate your help.

I am using NWDS for Java. I recently installed Lifecycle Designer. I believe this is a stand alone app for me to modify the .xdp file? it is not actaually a plugin for NWDS correct?

Do i need the adobe document services to be running in the Web AS? if its not running what problems would i see? because i can see the pdf, but i just can hide the stupid tool bar

krishanu_biswas
Active Participant
0 Kudos

Hello,

We have gotten even more confused with your last statement:

"Do i need the adobe document services to be running in the Web AS? if its not running what problems would i see? because i can see the pdf, but i just can hide the stupid tool bar "

Do you mean that you do not have an ADS installed yet and you are still able to create the PDF document. Thats not possible at all. You can not create a PDF document without the ADS. But you can surely deal with a pre-created PDF if you are using the "USEPDF" mode (check the "mode" property of the interactive form on the IDE). Please clarify.

In USEPDF mode, you need to handle the PDF differently with a different set of APIs. We will talk about that later. First of all, let us get some clarity on your requirement and what have you done so far.

Best Regards,

Krish

Former Member
0 Kudos

Hi Krishanu,

Sorry for any miscommunication.

I am indeed using USEPDF mode. I dont actually need to create any pdf. The pdf stream comes from the backend. What i want to do is have more control over the toolbar. Either hide the entire tool bar or maybe hide some buttons in the tool bar

As for weather ADS is installed on the Web AS, i understand it is actually installed. I am just not sure if it was causing my problems. Maybe not install correctly, or installed but running wrong settings etc.

krishanu_biswas
Active Participant
0 Kudos

Hello,

Had you mentioned about the NetWeaver and the SP stack you are on, that would have been very helpful.

Nevertheless, when you use the "USEPDF" mode, you should control the way a PDF should behave, look etc. The framework depends on you to provide the PDF and it just displays it on the screen and facilitates data processing. Hence, using IWDPDFDocumentInteractiveForm context won't help here. This particular interface is just a logical extension of the Interactive Form UI element when the framework takes care of the form object's life cycle and that happens in the "GeneratePdf" and "UpdateDataInPdf" modes.

This means, you need to use the IWDPDFDocumentAccessibleContext to send the PDF to the ADS with all the appearance setter calls that you already have in your code in your action methods of the view controller and then you should assign the resulting PDF back to the context which is bound to the pdfSource attribute. This is how you make sure that in the "USEPDF" mode (as the name suggests), you have complete control over the PDF you are using. With this, you also make sure that the framework does not come your way when you want to use your own PDF.

Please refer to the Javadoc for further details on the interfaces. It will be very similar to the code that you already have. You can get the PDF out of the context bound to the pdfSource context attribute. You can get the data XML by calling the methods on WDInteractiveFormHelper. Do a setPDF, setData and execute call with the appearance setters in place. You get a PDF back with the right appearance set (hidden toolbar etc). You would need to assign this now to the context attribute (of type binary) bound to the pdfSource property.

Let me know if i have confused you even more )

BR,

Krish

maarten_duits2
Participant
0 Kudos

Hi,

I tried it myself and when you set property of the UI element InteractiveFrom "mode" to "updateDataInPdf" it works for me.

I hope it helps.

Kind regards,

Maarten.

Former Member
0 Kudos

Krishanu,

Nope you have not confused me even more. In fact you were very clear.

I have modified my code to include,

IWDPDFDocumentAccessibleContext hmmmm = WDPDFDocumentFactory.getDocumentHandler().getDocumentAccessibleContext();

hmmmm.setPDF(wdContext.currentPdfInfoElement().getStream());

blah blah OLD CODE.......

wdContext.currentContextElement().setStream(hmmmm.execute().getPDF());

but now i am getting the following error,

com.sap.engine.services.webservices.jaxrpc.wsdl2java.ClientProtocolException: An error occured while reading data from the destination sap.com/tcwdpdfobject/com.sap.tc.webdynpro.adsproxy.AdsProxy/SecConfigPort_Document. The error was: java.security.cert.CertificateException No such view:.

at com.sap.security.core.client.ws.DeployableSecurityProtocol.transportSecurityHandleRequest(DeployableSecurityProtocol.java:560)

at com.sap.security.core.client.ws.DeployableSecurityProtocol.handleRequest(DeployableSecurityProtocol.java:197)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProtocolList.handleRequest(ProtocolList.java:69)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1423)

at com.sap.tc.webdynpro.adsproxy.SecConfigBindingStub.rpData(SecConfigBindingStub.java:82)

Oh yeah i am using EP7 SP10. as well as https

krishanu_biswas
Active Participant
0 Kudos

Hi,

As the error suggests that you do not have any certificate configured in your key store which is required to authenticate the client to the ADS. You would require to install a client certificate on your Web Dynpro/Portal server that will be used to authenticate the Web Service call to ADS.

But the question is whether you need "Https" for a server to server communication (from your portal server to ADS server) ? Normally, these two servers reside in the LAN. And i suppose you are not using any of the secured functionalities of interactive form (for example, digital signature, certification etc.). I assume that you need "https" call from browser to the portal server and then from portal server to the ADS should be on http. Please confirm on that. If that is the case, then you can follow the section below to change the "protocolSchemeForADSCall" to "http" always. This is what you would need to do in the Visual Administrator where your portal/web dynpro is installed:

In Visual Administrator. Go to ->

Server -> Services -> Configuration Adapter -> webdynpro -> sap.com ->

tcwddispwda -> Propertysheet default

Then goto property sap.protocolSchemeForADSCall

This property is available after you apply SAP note 849730.

Possible values are:

- request: same protocal scheme than the request to Web Dynpro has

- https: always use https

- http: always use http

SET the value as http. This will ensure that web Dynpro to ADS communication always happens on http, rather than on https.

Should you need to install SSL based communication between the two, you would need to follow the note:

838111 > How to configure SSL for Adobe Document Services

Best Regards,

Krish

Former Member
0 Kudos

Hi Krishanu,

Sorry i went missing, had to settle other more pressing issues. You were right we were using REQUEST. After changing to HTTP the previous error was gone but now we get,

java.net.ConnectException: Connection refused: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)

I have heard that ADS is not supported on EP7 SP10 for 64bit systems. Could this be a manifestation of non support?

Answers (1)

Answers (1)

Former Member
0 Kudos

Finnaly after solving all the ADS config problems that were giving error msgs, it turns out that SP10 does not support 64bit systems.

Anyway, thx for all the help guys