on 01-23-2009 12:13 PM
Hi,
In my application, i pleace ifram and bind to a context attribute of type string.
created a model with export parameter of type xstring. now i wanna convert this xstring to string and dispaly pdf in iframe.
i used below code to convert xstringtostring
String url = "";
WDWebResourceType webResType = WDWebResourceType.PDF;
IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);
try {
url = webResource.getURL();
} catch (WDURLException e) {
e.printStackTrace();
}
return url;
but its throgunig null pointer exception
when i use below code without iframe, i can see the pdf which is opening in external window
byte[] pdfContent = wdContext.currentXtstingElement().getE_Xstring();
String pdfFileName = "Test";
WDDeployableObjectPart objpart=wdThis.wdGetAPI().getComponent().getDeployableObjectPart();
IWDCachedWebResource pdfResource= WDWebResource.getPublicCachedWebResource(pdfContent,WDWebResourceType.PDF,WDScopeType.APPLICATION_SCOPE,objpart,"Page1");
try {
wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();
}
catch (WDURLException e)
{ wdComponentAPI.getMessageManager().reportException(e.getMessage(),false); }
but i dont want to open in external window. how to do dat
Hi Venkat,
Try like this:
Comment the below code
try {
wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();
}
catch (WDURLException e)
Create a context attribute url
wdContext.currentContextElement().setURL(pdfResource.getURL());
Create IFrame UI Element. Bind its source property with this url.
source url
Regards,
Siva
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.