on 02-04-2010 11:34 AM
Hi,
I have searched the forum for an answer on how to display a .tif file in my Web Dynpro ABAP. However, I could not find a suitable answer. Therefore, I will try again ...
My current solution is opening a browser window with a link to the .tif file, but that requires that the user download/opens the file via a pop-up before viewing it. Now I would like the file to be displayed directly without further user action. How can I achieve this?
Thanks.
I simple suggest to use the image UI control specifying the tiff file name in the source attribute.
It could be that you'll not find the .tiff file in the Component images list of the popup that you use to select the file but if you type the file name directly in the source attribute it works fine at runtime.
Sergio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm with Sergio; why not just use the Image UI element. Tiff can be a bit of strange file format and isn't always recognized the same way as JPG or GIF on the desktop. You could also consider using the IGS to convert the file to another format.
data: l_igs_imgconv type ref to cl_igs_image_converter,
l_img_blob type w3mimetabtype,
l_img_size type w3param-cont_len,
l_bmp_xstream type xstring.
create object l_igs_imgconv.
l_img_size = xstrlen( gx_content ). "The binary string with your TIFF Image Data
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = gx_content
tables
binary_tab = l_img_blob.
call method l_igs_imgconv->set_image
exporting
blob = l_img_blob
blob_size = l_img_size.
l_igs_imgconv->input = 'image/tiff'.
l_igs_imgconv->output = 'image/jpeg'.
call method l_igs_imgconv->execute
exceptions
others = 1.
if sy-subrc is initial.
call method l_igs_imgconv->get_image
importing
blob = l_img_blob
blob_size = l_img_size.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = l_img_size
importing
buffer = e_xstream
tables
binary_tab = l_img_blob
exceptions
failed = 1
others = 2.
endif.
With FireFox and Google Chrome I had no problem with .tiff file but you're right with IE there are problems. I forgot IE, sorry.
Testing now with IE 8.0 I confirm that I can see the .tiff image but looking better I discovered that it is quicktime plug-in that takes care of the visualization.
I think this is a general IE behavior; do you think is it a specific issue related to Web Dynpro ABAP instead?
For sure Thomas suggested a great approach....
Sergio
Hi Thomas, I have used your code successfully thanks for that. However have hot an issue with multi pages on a tiff where the code appears to only deal with a single page tiff image converting to JPG.
Looks like link Converting multi pages tiff image into PDF in ABAP | SCN has a similar issue.
Have you experienced this? Can we use the same converter class for multi page tiff to jpg?
Many thanks
Daniel
I suggest creating a BSP with the content type of the .TIF file. Embed your BSP in a frame inside your webdynpro then when it comes time to view the file, send the content to your bsp.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As i think it is not possible. we can not stop that popup to come.
This is provided basically for security purpose, so that any file do not get uploaded in ur system or gets open by default.
This is a browser function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.