Edge not showing download option with PDF object? - object

I have an PDF embedded in the page using the following code:
<object width="100%" height="800" type="application/pdf" data="/example.pdf" id="pdf_content">
<p>Insert your error message here, if the PDF cannot be displayed.</p>
</object>
Every browser shows an option to download the PDF when hovered.
Are there any parameters that can be added in order to show the save option?
Thanks

Related

I need help. Animated .SVG file

I would like the animated svg file that I uploaded to my WordPress site to play in a loop.
This is part of the code added to a page it will only animate once.
<object data="animated.svg" type="image/svg+xml" width="300" height="150"></object>

Is there a inbuilt tag in JSF 2.0 that can support Application/PDF content Type

I'm performing a F:AJAX call where I receive a byte Stream output whose content type is application PDF. I want this bytestream to be loaded in a JSF equivalent tag which should make me specify the content type as "Application/PDF" during tag declaration. Also, f:View fails saying content type not supported. Any JSF specific tags to cater this. Thanks.
Use iframe tag. This line shows how to use it:
<iframe src="foo.pdf" width="600" height="400" scrolling="no"></iframe>
If you also want to hide the (default) border, add frameBorder="0".
There is also pdf.js library that allows to browse pdf in browser. https://blog.oio.de/2014/04/11/integrating-pdf-js-pdf-viewer-web-application/
The answer is no there isn't such a tag.
To be honest there's no need to change it, since using HTML for this is fine and really the simplest way. You can use IFRAME (like Jay Smith shows you) or OBJECT.
The same way is presented on PrimeFaces's showcase:
<h3>PDF</h3>
<object type="application/pdf"
data="/showcase/resources/demo/media/guide.pdf?pfdrid_c=true"
height="300px" width="100%" internalinstanceid="3">
Your browser can't display pdf,
click
to download pdf instead.
</object>

Displaying PDF , Richfaces

How can I display a PDF document on a rich:popupPanel. I am trying to display PDF document in a popup from a view scoped JSF page.
Issue faced : Parent page stops working when I click on the h:commandLink which fires a new view to display the PDF
The simplest way I know is to use HTML directly. You can use IFRAME or OBJECT.
So just put something like this in your rich:popupPanel:
<rich:panel>
<iframe src="path_to_your_file/sample.pdf"
class="pdfFrame" width="800" height="1000" scrolling="no" />
</rich:panel>
I don't think there's a way to do this with pure JSF tags. The same way is presented on PrimeFaces's showcase:
<h3>PDF</h3>
<object type="application/pdf"
data="/showcase/resources/demo/media/guide.pdf?pfdrid_c=true"
height="300px" width="100%" internalinstanceid="3">
Your browser can't display pdf,
click
to download pdf instead.
</object>

object pdf type is not render in mozilla and chrome

Im doing a document searching system, that shows a list of pdf like response, I´m working with primefaces 5
this is my code
<h:outputLink value="file/#{document.pdfPath}" target="_blank" >view document</h:outputLink>
<div id="pdf2">
<object data='file/#{document.pdfPath}'
type='application/pdf'
width='700px'
height='400px'>
<p>It appears your Web browser is not configured to display PDF files.
No worries, just <a href='file/#{document.pdfPath}'>click here to download the PDF file.</a></p>
</object>
<div id="pdf">
<object data="http://www.gnu.org/software/hello/manual/hello.pdf" type="application/pdf" width="450" height="375"></object>
</div>
But this is the problem in eclipse and IE browser runs perfect,but in chorme and mozilla only show the pdf that doesn´t come from a managed bean.
it is what I´m watching
With chrome
With mozilla
and finally Internet explorer (works perfect here)
Here, from your response headers:
Content-Disposition: attachment; filename="contratotest.pdf"
Your /file servlet is serving the PDF as an attachment. This is intented for the "Save As" dialogue thing. If you intend to display the content inline in the web page instead of as an attachment of the web page, then you need to set it to inline.
response.setHeader("Content-Disposition", "inline");
Or just remove it entirely. It's the default already. You may only need to add an extra parameter to the fallback link to force attachment anyway when clicked.

Is this a safe way to show .swf files?

Hello currently I am showing some .swf files inside my website but I don't know if I have left any case for potential security flaws or if the way I am using the swf files isnt correct for all browsers or slows down the page not sure if im doing it right.
This is the code I have now:
<object width="200" height="300" data="album.swf"></object>
I read on this post: How to embed a SWF file in an HTML page?
I am puzzled because the above method mentioned on the post appears to slow down the website with the javascript calling and all.
What is your opinion? Why do they use swfobject?
Edit: Is this correct?
<embed allowScriptAccess="never" allownetworking="none" src="album.swf" type="application/x-shockwave-flash" quality="high" width="750" height="463" name="Album" />
Thank you!

Resources