cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing tiff images

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks for your help. It seems the upgrade to sp14 solved the problem.

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Former Member
0 Kudos

The constructor WDWebResourceType(String, String, boolean, boolean) is not visible... it's protected!!

Former Member
0 Kudos

Ellis,

Does it really matter in this context?

Anyway:


final boolean isAttachment  = <...>;
 
final WDWebResourceType wrtTIFF = new WDWebResourceType
(
  "tif", "image/tiff", isAttachment
);

How the code above is not working?

VS

Former Member
0 Kudos

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