on 10-12-2005 3:44 PM
I have the binary for a tiff which I stored in SAP. I wish to output this tiff into an externalWindow. If I wanted to do this for a word document the code is as follows:
WDWebResourceType resourceType = new WDWebResourceType("doc", "", false);
byte[] pdfContent = .......
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,resourceType.DOC);
wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getAbsoluteURL(),"View Doc",true).open();
And if I want to work this out for all documents then I would use the following code...
String fileExtension = .....
WDWebResourceType resourceType = new WDWebResourceType(fileExtension, "", false);
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent, resourceType.getWebResourceTypeForFileExtension(fileExtension));
wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getAbsoluteURL(),"Report View",true).open();
The problem is WDWebResourceType does not support TIFF.
Does anyone know another way apart from creating a temp file on the file system and using the image viewer?
Thanks
Ellis
Thanks for your help. It seems the upgrade to sp14 solved the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I change the code to:
final WDWebResourceType wrtTIFF = new WDWebResourceType( "doc", "application/msword", false);
then the following code works fine:
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent, wrtTIFF);
wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getAbsoluteURL(),"View TIFF",true).open();
It is only when I use:
final WDWebResourceType wrtTIFF = new WDWebResourceType( "tif", "image/tiff", false);
that it fails.
Any ideas?
Thanks very much,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you run the follwing code the window is not created with the tiff and when you try to save the tif it is 0 bytes.
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent, wrtTIFF);
wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getAbsoluteURL(),"View TIFF",true).open();
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The constructor WDWebResourceType(String, String, boolean, boolean) is not visible... it's protected!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Elis,
<i>The problem is WDWebResourceType does not support TIFF.</i>
How's that?
final boolean isAttachment = <...>;
final boolean add2container = <...>;
final WDWebResourceType wrtTIFF = new WDWebResourceType
(
"tif", "image/tiff", isAttachment, add2container
);
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.