on 10-06-2005 8:41 AM
Hello,
I have a problem showing a PDF in a new window. I get my PDF created from a BAPI as a byte[] - works fine. To show the PDF I use the follwong code in an action of a button:
byte[] pdfContent = wdContext.currentContextElement().getPdfDokument();
try {
IWDWebResource pdfResource = WDWebResource.getWebResource
(pdfContent, WDWebResourceType.PDF);
wdComponentAPI.getWindowManager().createExternalWindow(
pdfResource.getURL(),"Title",
false).open();
} catch (WDURLException e) {
e.printStackTrace();
}
It works fine - but just the <b>first time</b> I press the button. Window is opened and inside Acrobat Reader openes with my PDF.
I close that and press button again. Window openes but no PDF anymore?! Any hints?
Best regards,
Frank
Hi Frank,
try the following Tutorial:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on excel export using the web dynpro binary cache - 34.htm
The class used there is IWDCachedWebresource instead of IWDWebResourced.
I adapt it to use a PDF as a byte [] (build from an InputStream) and it works fine for me.
regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi..
Will you pls send me that complete coding to display PDF in the window.
i am having same problem like you have.. But i am new comer..so i am not getting what u did?
it's urgent...pls reply ASAP..
with regards,
Gobinath.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Frank,
sorry i can't help you with this problem.
But can you tell me, how you create a PDF-file via a BAPI in the backend system and send it in a byte-stream to a Web Dynpro?
Kind regards,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem than Jesus.
In:
IWDWebResource pdfResource = WDWebResource.getWebResource
(pdfContent, WDWebResourceType.PDF);
wdComponentAPI.getWindowManager().createExternalWindow(
pdfResource.getURL(),"Title",true).open();
the program does not recognize the pdfResource variable.
any suggestion ?
thanks in advance.
Leandro
Hi,
I have a problem. I'm trying to display a smartform from a webdynpro application, but when I try to write:
IWDWebResource pdfResource = WDWebResource.getWebResource
(pdfContent, WDWebResourceType.PDF);
wdComponentAPI.getWindowManager().createExternalWindow(
pdfResource.getURL(),"Title",true).open();
the program does not recognize the pdfResource variable. It says that it cannot resolve it.
Any hints?
Thanks.
Jesus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
that does not help... I tried both and result is always the same.
It works fine if I use the way of the tutorial to open a small Dialogbox with a FileDownload Element. But this I don't want, I want to open the window directly after pressing the button.
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.