B4J Question b4j web server and pdf

yfleury

Active Member
Licensed User
Longtime User
For a web server B4J I have pdf I want to show in browser. I need a web page to add a return link then I want to use a iframe tag, but chrome show me file name and a button to open pdf (download)

I am lost with that.

cap.png
 

Quandalle

Member
Licensed User
with content type, save as open directly. I just want to show pdf inside web page
Depending on a setting in their configuration, Chrome (and other browsers) can either open the pdf in the browser or download it directly.
For chrome see the setting below :
PDF param.png
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
Depending on a setting in their configuration, Chrome (and other browsers) can either open the pdf in the browser or download it directly.
For chrome see the setting below :
View attachment 139673
I finally find where is it. Now i can display pdf in chrome browser on computer. But I still problem for cell and tablet. I don't find where to change it. Is it another way to display pdf in browser, because for many clients, I don't want to explain to all, one by one, how to...
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
HTML:
<iframe src="https://www.w3docs.com/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf" width="100%" height="900px" frameborder="0"></iframe>
I try that but i see image in first post
 
Upvote 0

Quandalle

Member
Licensed User
I finally find where is it. Now i can display pdf in chrome browser on computer. But I still problem for cell and tablet. I don't find where to change it. Is it another way to display pdf in browser, because for many clients, I don't want to explain to all, one by one, how to...
the HTTP response should include these headers:

to view in browser :
Content-Type: application/pdf
Content-Disposition: inline; filename="filename.pdf

to download :
Content-Type: application/pdf
Content-Disposition: attachment; filename="filename.pdf"

see : https://developer.mozilla.org/fr/docs/Web/HTTP/Headers/Content-Disposition
 
Upvote 0
Top